Don't know why a web request return HTML instead JSON. Can anyone please help.
private void Test()
{
string url = "https://www.netonnet.no/Category/GetFilteredCategory";
string json = "{'sectionId':'10978','filter': '[]','sortOrder':-1,'sortBy':0,'pageSize':96,'listType':'10'}";
string result = "";
using (var client = new WebClient())
{
client.Headers[HttpRequestHeader.ContentType] = "application/json";
result = client.UploadString(url, "POST", json);
}
Debug.WriteLine(result);
}
Talk1:
What's the HTML, and what's the returned HTTP status code?
Talk2:
This is the beginning of HTML received '' and HTTP status code = 200
Talk3: