远程服务器返回错误:(404)Not Found - Using API

时间:2013-09-09 07:59:54

标签: c# .net api httpwebrequest

我开始使用新的API(appoxee)。 发送请求时,我收到了“(404)Not Found”。

这是我用来发送请求的代码:

var request = WebRequest.Create("http://saas.appoxee.com/api/") as HttpWebRequest;
request.Method = WebRequestMethods.Http.Post;
request.ContentType = "application/json";

// Add the content to the request
string postDataJsonFormat = CreateExampleTagRequest();
byte[] byteArray = Encoding.UTF8.GetBytes(postDataJsonFormat);
request.ContentLength = byteArray.Length;

Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();

// Getting and processing the response
var response = request.GetResponse() as HttpWebResponse;

我知道这是正确的api url,无法弄清楚这里有什么问题。

0 个答案:

没有答案