Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query parameters and urls ending in / #25

Closed
gcotelli opened this issue Oct 23, 2018 · 2 comments
Closed

Query parameters and urls ending in / #25

gcotelli opened this issue Oct 23, 2018 · 2 comments

Comments

@gcotelli
Copy link
Contributor

Hi Sven,
Do you know if the url obtained by asking a ZnUrl to attach a parameter is valid in case the original url ends with a / ?
For example:
'https://google.com/search/' asZnUrl withQuery: 'q' -> 'hello'
will produce a ZnUrl looking like https://google.com/search/?q=hello
To me it looks really strange ( and in this case for google it's not the same having or not the slash)

I've simplified the example but in my case I have a url coming from some teapot route and I want to attach some queries to it and I'm getting this kind of URL.

@svenvc
Copy link
Owner

svenvc commented Oct 23, 2018

Why not

'https://google.com/search' asZnUrl withQuery: 'q' -> 'hello'. 

=> https://google.com/search?q=hello

?

I think they are both valid, I depends on what the server expects.
But I did not check the specs.

@gcotelli
Copy link
Contributor Author

I don't have direct control over the incoming URL. Just looked strange to me, but if it's valid syntax I think then there's no problem in adding ?after /.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants