how to do request base_url without trailing slash? #3076
Replies: 3 comments 1 reply
-
What's wrong with async with httpx.AsyncClient(base_url='http://localhost:8000/api') as client:
response = await client.request('GET', 'books') |
Beta Was this translation helpful? Give feedback.
-
the same as with async with httpx.AsyncClient() as client:
response = await client.request('GET', 'http://localhost:8000/api/books') Under |
Beta Was this translation helpful? Give feedback.
-
Sorry, but it is a very bad solution, as client may be passed as argument to a service, that nothing knows about |
Beta Was this translation helpful? Give feedback.
-
This example does request 'http://localhost:8000/api/books/', but I don't want trailing slash, how do I achieve that?
Note:
That's not the case described #2673, as final url is not empty.
The above issue is about joining - if nothing was passed => no join should be made.
Beta Was this translation helpful? Give feedback.
All reactions