Maybe this is something already answered, sorry if so.
I just need to know how to always get the status code returned by the server.
Is it with http_header() or with http_error()?
TIA
How do I get the http status code?
-
- Site Admin
- Posts: 872
- Joined: Sun Jul 04, 2021 5:12 am
Re: How do I get the http status code?
You can receive it by passing the appropriate parameter to http_error.
Or, you can just receive it as the return value from http_req, http_url_post_xxx, http_url_get_xxx, etc. They return any response code EXCEPT 200 -- instead of 200 they return 1 instead... so you can just say "if code=1; eval code=200; endif" or whatever, and you'll have the return code.
Or, you can just receive it as the return value from http_req, http_url_post_xxx, http_url_get_xxx, etc. They return any response code EXCEPT 200 -- instead of 200 they return 1 instead... so you can just say "if code=1; eval code=200; endif" or whatever, and you'll have the return code.