HTTPClient GET and JSON Payload

Topics: Web Api
Aug 24, 2011 at 2:07 PM

Hi,

How do you make a HTTP GET using HTTPClient that passes JSON as a payload?

In IQueryable exaample, it's illustrated to POST JSON payload using HTTPClient.

For CRUD scenarios, POST URI will be typically reserved for INSERT/UPDATE and GET URI will be reserved for SELECT operations.

While doing this SELECT operations it may be necessary to pass in more than 1 parameter(like street,zipcode, etc instead of just customerId).

In such scenario, multiple parameters can be clubbed together as JSON payload and the invoke GET operation. Is this recommended?

Thanks.

Aug 26, 2011 at 7:04 PM

I don't believe that GET requests can contain payloads http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-14#section-7.3.

You might want to include parameters in the querystring.