posva / mande

<700 bytes convenient and modern wrapper around fetch with smart extensible defaults
https://mande.esm.is
MIT License
1.19k stars 42 forks source link

Not adding trailing '/' to request #328

Closed panmenghan closed 2 years ago

panmenghan commented 2 years ago
const rpc = mande('/rpc/endpoint')

rpc.post({some_rpc_name, ...}) // -> mande will always add trailing `/`, so the request path change to `/rpc/endpoint/`

My use case is the server has only one endpoint to serve all the requests(not REST API), my current workaround was let the server to listen to /rpc/endpoint and /rpc/endpoint/ both.

May add a option to disable adding the trailing / to the request path?

dmix commented 2 years ago

this is a major recurring problem for me. Any chance we could get it merge? It would be much appreciated :D