Is it possible to invoke API for a private Worker using HTTP Service bindings?
Is it possible to make arbitrary API requests from the frontend to the backend using the worker's HTTP Service Bindings?
In a typical use case, it is known that a request to a worker can be forwarded to another worker.
It is also stated that arbitrary requests can be made by providing a fully qualified URL as shown below.
via https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/http/
If let
workers_dev=false
on WORKER_B
and hide the hostname, can we use fetch
to call any API on WORKER_B
?
Or should we use RPC for this use case?
Assumed usercase:
1 Reply
Just in the case for a local env, creating a Request object as shown below worked as expected.
So, I will close this thread as resolved.