main.go1110 chars54 linesThis code creates an HTTP request with a custom JSON body and returns a JSON response. It defines a MyRequest struct which is marshaled into a JSON string and included as the request body. The Content-Type request header is set to application/json to indicate to the server that we're sending JSON data. After executing the request, the response body is decoded into a MyResponse struct.
gistlibby LogSnag