#silly : what is the difference between a client and a server request

4 messages · Page 1 of 1 (latest)

frosty crane
#

a client one would be when u directly create one in golang? and the server one is the one that you receive in the server?

        // Body is the request's body.
    //
    // For client requests, a nil body means the request has no
    // body, such as a GET request. The HTTP Client's Transport
    // is responsible for calling the Close method.
    //
    // For server requests, the Request Body is always non-nil
    // but will return EOF immediately when no body is present.
    // The Server will close the request body. The ServeHTTP
    // Handler does not need to.
    //
    // Body must allow Read to be called concurrently with Close.
    // In particular, calling Close should unblock a Read waiting
    // for input.
    Body io.ReadCloser
light remnant
#

Yes

#

Client is when you make the request to send to some server
Server is the request that you recieve from some client

earnest parrot
#

for http requests from browsers they on default add a few more headers usually than a default go net/http request

other than that i don't think there is much