relative pathname in Request not working on POST request
Using the pathname in a GET request everything works fine.
Code:
But using a POST request I get the error:
TypeError: Failed to construct 'Request': Invalid URL "/api/brand"
.
If I use the absolute server url (like http://localhost:3000/api/brand
) it just works fine.1 Reply
using the test client might be easier than constructing the reqs yourself: https://hono.dev/docs/helpers/testing
but my best guess would be that
app.request
is doing some relative path resolution under the hood that Request
doesn't
https://developer.mozilla.org/en-US/docs/Web/API/URL