Go server and Java client communication

helpme :

How to have a communication between a go server and java client without any external libraries?

Scott Yu :

Java and Go, C# and Go, Go and C#, C and GO, GO and Python All languages's communication is works.

You can build http server in Go (it is not external library) and, You can requests and get responses in Java.

For example,

package main

import (
    "net/http"
)

func main() {
    http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
        w.Write([]byte("Hello, World!"))
    })
    http.ListenAndServe(":8000", nil)
}

The code above is Golang's http server example.

and, You can find more information with Java http requesting,

then you should check this information.

JAVA HTTP REQUEST, GET/POST

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=409599&siteId=1