Reputation: 6240
I'm using the URL API in my React Native application to conveniently construct query strings for my requests.
I found out that this API adds a trailing slash to the URL which breaks all the requests.
let uri = new URL('https://example.com/path');
console.log(uri.toString());
// https://example.com/path/
I made some tests in a browser (Chromium 87) and found out that this behavior is not present there. Is it a quirk of React or React Native?
The question is how can I prevent the addition of a trailing space to the URL?
Upvotes: 0
Views: 766