#Alternative to Fetch API (can't add body to GET)

2 messages · Page 1 of 1 (latest)

mental spire
#

Is there an alternative to the Fetch API within a Cloudflare worker? Axios does not work (as it relies on Node libs) .. I assume other packages will have a similar problem. Reason is because a vendor API requires a body on a GET request and that produces a "TypeError: Request with a GET or HEAD method cannot have a body". At this point I am considering proxying the request via an AWS Lambda but would love a workaround within a the Cloudflare environment.

south hornet
#

An alternative would just use the fetch API anyway. You could send over TCP and craft your own HTTP/1.1 request