On rare occasions, you might need to get the HTTP status code and headers of the target host. It is pretty easy to do now.
Get the HTTP response status code and headers with screenshots
On rare occasions, you might need to get the HTTP status code and headers of the target host. It is pretty easy to do now.
We deployed a new version of the API that returns the HTTP response status code and headers when possible.
To get the status code or the headers, just set one of the needed parameters to true: metadata_http_response_headers=true
or metadata_http_response_status_code=true
. And you will get all the data when available:
In the example, above it is rendered as JSON, because response_type is set to json
and cache
to true
. But if you render a binary screenshot, not JSON, you can get that data from the API response headers as X-ScreenshotOne-HTTP-Response-Status-Code
and ScreenshotOne-HTTP-Response-Status-Headers
.
Headers and status codes might not be available when the target host DNS name is not resolved, there is a network error, or even just timeout error and the host doesn’t respond.
Hope you find it helpful, enjoy and have a nice day!
Interviews, tips, guides, industry best practices, and news.
Google Cloud gives $300 in credits for 3 months for experimenting. And I decided to give it a try, but not because of the free credits.
Now you can get favicon used by a website with ScreenshotOne API in just one simple API call.
I am really sorry but we moved our affiliate program to Tolt because Reflio is not in active maintenance anymore—it is a forced move.
Exhaustive documentation, ready SDKs, no-code tools, and other automation to help you render website screenshots and outsource all the boring work related to that to us.