Windows phone 8.1 POST x-www-form-urlencoded 不工作
Windows phone 8.1 POST x-www-form-urlencoded not working
我正在尝试在 C# 中发送 POST x-www-form-urlencoded 请求付款方式 api。
这是我的代码:
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, new Uri(url));
List<KeyValuePair<string, string>> bla = new List<KeyValuePair<string, string>>();
bla.Add(new KeyValuePair<string, string>("id_number","2000"));
request.Content = new HttpStringContent(new HttpFormUrlEncodedContent(bla).ToString(),Windows.Storage.Streams.UnicodeEncoding.Utf8, "application/x-www-form-urlencoded");
Api returns 我状态码100代表"wrong id_number".
我也尝试通过 Postman 发送 POST 并且工作正常。
POST /services/test HTTP/1.1
Host: example.tk
Cache-Control: no-cache
Postman-Token: c67b2ee3-6e25-7ecc-61f5-38282c23sds7d
Content-Type: application/x-www-form-urlencoded
id_number=2000
有人知道我错过了什么吗?
使用 NavigateToString("") 并在内部添加 html 表单和 post :D
我正在尝试在 C# 中发送 POST x-www-form-urlencoded 请求付款方式 api。
这是我的代码:
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, new Uri(url));
List<KeyValuePair<string, string>> bla = new List<KeyValuePair<string, string>>();
bla.Add(new KeyValuePair<string, string>("id_number","2000"));
request.Content = new HttpStringContent(new HttpFormUrlEncodedContent(bla).ToString(),Windows.Storage.Streams.UnicodeEncoding.Utf8, "application/x-www-form-urlencoded");
Api returns 我状态码100代表"wrong id_number".
我也尝试通过 Postman 发送 POST 并且工作正常。
POST /services/test HTTP/1.1
Host: example.tk
Cache-Control: no-cache
Postman-Token: c67b2ee3-6e25-7ecc-61f5-38282c23sds7d
Content-Type: application/x-www-form-urlencoded
id_number=2000
有人知道我错过了什么吗?
使用 NavigateToString("") 并在内部添加 html 表单和 post :D