1

I'm trying to post to an API using C#.

Here is some documentation on the API: http://docs.gurock.com/testrail-api/accessing

Here is what I have so far:

string url = "https://example.testrail.com//index.php?/miniapi/add_result/1&key=19e73cdd99fbad172d3523b13d1c8c8f";

HttpWebRequest req = WebRequest.Create(new Uri(url))as HttpWebRequest;
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";

My question is how can I pass in a Status_id of 1 and a comment of "Test" and then post to the API?

4

1 回答 1

0

您需要在对象GetRequestStream上调用该方法req,并将发布参数写入该对象

于 2013-06-11T16:26:31.997 回答