我正在尝试使用 web api 来下载页面。api的链接:http: //api.arbetsformedlingen.se/
如果我使用如下代码:
HttpClient c = new HttpClient();
c.BaseAddress = new Uri("http://api.arbetsformedlingen.se/");
var response = c.GetAsync("platsannons/soklista/kommuner?lanid=10").Result;
该请求如下所示:
{Method: GET, RequestUri: 'http://api.arbetsformedlingen.se/platsannons/soklista/kommuner?lanid=10', Version: 1.1, Content: <null>, Headers:{}}
这还不足以得到有效的回应吗?我得到的是一个 400 Bad 请求:
StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:{ Connection: close Proxy-Connection: keep-alive Date: Fri, 28 Jun 2013 10:02:34 GMT Server: Apache Content-Length: 117 Content-Type: application/json; charset=UTF-8}
我需要在内容中包含一些内容吗?