我在我的应用程序中使用HttpFormUrlEncodedContent
PostAsync
Windows.Web.Http.HttpClient
HttpFormUrlEncodedContent httpFormUrlEncodedContent = new HttpFormUrlEncodedContent(new[] {
new KeyValuePair<string, string>("parameterOne", "value of one"),
new KeyValuePair<string, string>("parameterTwo", "value of two"),
new KeyValuePair<string, string>("parameterThree", "value of three"),
new KeyValuePair<string, string>("scope", "FIRST_PARAMETER+SECOND_PARAMETER+THIRD_PARAMETER")
});
HttpClient httpClient = new HttpClient();
response = await httpClient.PostAsync("http://mysuperdupperurl.com", httpFormUrlEncodedContent);
方法FIRST_PARAMETER%2BSECOND_PARAMETER%2BTHIRD_PARAMETER
,我设置如下:
HttpFormUrlUnencodedContent
我的问题是范围是编码的,当它到达服务器时会抛出错误,因为编码看起来像这样:
PostAsync
那么,是否有某种{{1}}或其他方式来定义我的{{1}}方法的内容?