Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

Added proto.Message to url.Values Function for GET-Requests #3

Closed
wants to merge 1 commit into from
Closed

Added proto.Message to url.Values Function for GET-Requests #3

wants to merge 1 commit into from

Conversation

Codehardt
Copy link

Sending GET Requests with a proto.Message was not possible. The apiclient::do(...) just added the proto.Message to the POST Body.

This solution checks if the method equals GET and converts the proto.Message to url.Values. Then it is possible to call the already implemented function apiclient::get(...)

@hillu
Copy link
Owner

hillu commented Jul 18, 2017

apiclient..do() does not add the proto.Message to the body but a JSON-serialized form of the struct.

GET requests containing a body are valid and GRR understands them, so I see no need for this change.

@Codehardt
Copy link
Author

GET requests containing a body are valid and GRR understands them [...]

Not working for e.g. apiclient.ApiListHuntsArgs. Sending a ListHunts GET Request with JSON-Body {"count": 10, "offset": 5} does not work, but sending the ListHunts GET Request with GET Params count=10&offset=5 works.

@hillu
Copy link
Owner

hillu commented Jul 18, 2017

Damn.

This means that we'll have to fix the code-generator for the GET and GET-simple variants.

@hillu hillu closed this in c2006fd Jul 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants