Skip to content

Add request/response logging #181

@andig

Description

@andig

For debug purposes it would be nice to log requests and responses. This is to some extend possible by using a custom http.Do()er. However, the Doer will not- afaiu- be aware if the server is using gzip'ed responses. I'd be interest in logging the response in plaintext.

Update

The transport doesn't see the gzip'ed data transparently due to

    func (c *Client) doHttpRequest(ctx context.Context, body io.ReadSeeker) *rawGraphQLResult {

		request.Header.Add("Accept-Encoding", "gzip")

It might be sufficient to remove this client header and let the http.Transport determine if it should be added automatically (I cannot say under which conditions it would do so).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions