【发布时间】:2013-04-14 13:48:21
【问题描述】:
我正在使用 ServiceStack 客户端调用 web 服务,如下所示:
var client = new JsonServiceClient(apiUrl);
var url = "/V1/MyApiCall";
var response = client.Post<MyApiCallResponse>(url, "foo=" + request.foo + "&bar=" + request.bar);
这通常效果很好,但是我需要更改 Content-Type 标头。默认情况下(以及我从该服务进行的大多数其他调用)这需要是application/json,但在这种特殊情况下它需要是application/x-www-form-urlencoded。
client.ContentType 没有实现 setter,那么如何更改 Content-Type 标头?
【问题讨论】:
标签: c# forms ormlite-servicestack