[ Base URL: codetabs.io/ ]
CORS proxy endpoint for browser fetches. Send any HTTP method to /v1/proxy with the target URL in quest.
| Name | Description |
|---|---|
| quest * requiredstring(query) | The address to fetch, http or https. Percent-encode it if it has a query of its own. |
| Code | Description |
|---|---|
| 200 | Whatever the other side answered, its status and headers included, with Access-Control-Allow-Origin: * |
| 400 | Not fetched: no address, or not a public one |
| 502 | Could not fetch: the other side did not answer |
CodeTabs API: fetch any web address from here, with CORS headers on the answer
The answer as it came, status and headers included:
curl 'https://www.codetabs.io/v1/proxy?quest=https://httpbin.org/anything/fetch-me'
As JSON, with "body", "status", "content_type", "url" and "headers":
curl 'https://www.codetabs.io/v1/json?quest=https://httpbin.org/anything/fetch-me'
Your method, headers and body are passed on:
curl -X POST -H 'Content-Type: application/json' -d '{"a":1}' 'https://www.codetabs.io/v1/proxy?quest=https://httpbin.org/anything/post-me'
If you can only send a GET, name the method and the body in the query, before the address:
curl 'https://www.codetabs.io/v1/proxy?method=POST&body=a%3D1&quest=https://httpbin.org/anything/post-me'
From a web page:
fetch('https://www.codetabs.io/v1/proxy?quest=https://httpbin.org/anything/fetch-me').then(r => r.text())
httpbin.org in these examples is a public test service that answers with a description of the request it got.
http and https only. Redirects are followed. No key, no account.