use*_*101 2 c# json http http-post
我正在尝试创建一个HTTP Post,它返回一个带有2个属性的JSON对象.
详情如下:
使用包含字符串的表单编码数据的HTTP POST到http://text-processing.com/api/sentiment/.重新调整具有2个属性的JSON对象响应; 标签和负面.
我想在c#中这样做,这是我在努力的地方.
谢谢
您可以尝试使用WebClient这样的
WebClient webclient = new WebClient();
NameValueCollection postValues = new NameValueCollection();
postValues.Add("foo", "fooValue");
postValues.Add("bar", "barValue");
byte[] responseArray = webclient.UploadValues(*url*, postValues);
string returnValue = Encoding.ASCII.GetString(responseArray);
Run Code Online (Sandbox Code Playgroud)
MSDN页面也有一个例子.
| 归档时间: |
|
| 查看次数: |
3457 次 |
| 最近记录: |