简体   繁体   中英

How to handle page not found by HttpClient?

I'm making two calls to the same domain but different methods from the F12 in FF. Both are generated fine and give me back a JSON structure.

Then I perform the same calls (same credentials, same everything) using HttpClient . The first gives me back the data just as supposed to. The other produces an HTML document the contents of which are rather large but there's text saying:

You may have landed here because you typed in the wrong adress or because the page has been moved.

The only strange thing I can see is that the status code is 201 and not 200 but that's only saying that the document's been created (we're talking FF, where I can see the status code).

Can something be concluded based on this or is it too vague?

per your request Konrad Viltersten

could you show the code for the call that is not working that would help out for the HttpClient call that is not working perhaps you need to do that call via .GetAsycn or .PostAsync calling methods

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM