mrvwman
CDCloudflare Developers
•Created by mrvwman on 8/8/2024 in #pages-help
Is there a way to get an exact copy of what fetch sends?
I'm using Page functions and within the onRequest function I am using fetch to make a post request to another server.
The remote server receives the request that is in some way different from what I'm intending to send, resulting in failure.
Using wrangler and devtools I can copy the request that's failing as a curl request and when executed it succeeds.
Dumping the javascript request object to console.log shows things looking as I would expect.
When I copy the fetch code from the function.js file into a browser webpage context it executes successfully. I don't have access to the remote server to know exactly what it's receiving. Is there a way to capture exactly the HTTP request that's being made from the cloudflare function to the remote server?
When I copy the fetch code from the function.js file into a browser webpage context it executes successfully. I don't have access to the remote server to know exactly what it's receiving. Is there a way to capture exactly the HTTP request that's being made from the cloudflare function to the remote server?
2 replies
CDCloudflare Developers
•Created by mrvwman on 12/30/2023 in #general-help
R2 vs Pages for Simple Static Site
For a simple static site should I use pages or r2?
I've used pages before when creating sites using dev tools like npm, react, git/github.
In this particular case the site is generated from a wysiwyg tool that doesn't need a github repo so I just upload the assets via the browser to either pages or r2.
I've not yet connected an r2 bucket to a domain, but seems pretty straightforward. Does anyone have any pro/con advice?
3 replies