weixin_33733810 2016-03-29 14:00 采纳率: 0%
浏览 45

REST发布方法难度

There is an application which is used for taking surveys. I want to use REST api and add some questions to the survey. So basically I want to update some pages of the survey. Here are the links of that application.

My surveys name is trial and the page number that I want to update is 2.

fields#updateobject

Here is my code to do. But i think the http call I have used is not correct. and I am not able to figure out how to make the request.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net.Http.Headers;

namespace ConsoleApplication1
{

     class Program
     {
        private static object post;
        private static object response;

        static void Main(string[] args)
        {
            RunAsync().Wait();
        }

        static async Task RunAsync()
        {
            string webReq =      "https://restapi.survey.com/v4/survey/trial/surveypage/2?_method=POST?api_token="/*token goes here*/;
           // $.post{webReq};

        }
    }
}
  • 写回答

1条回答 默认 最新

  • ?yb? 2016-03-29 14:14
    关注

    Use System.Net.Http.HttpClient class for sending requests to any API. Tutorial and examples on sending various requests (GET, POST, etc.) can be found here.

    评论

报告相同问题?