Reputation: 1220
I'm using the JsonHttpClient to communicate to an existing REST server. Is there any way to specify to send certain parameters as Query / form parameters?
Upvotes: 1
Views: 872
Reputation: 143389
We don't recommend using ServiceStack's Service Clients for 3rd Party APIs, instead you can use HTTP Utils which are more flexible and will let you send queryString with:
var url = baseUrl
.AddQueryParam("foo", 1)
.AddQueryParam("bar", 2);
As well as a number of different APIs to send HTTP FormData, e.g:
var response = url
.PostToUrl("Username=mythz&Password=password");
var response = url
.PostToUrl(new Login { Username="mythz", Password="password" });
Upvotes: 3