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

Add keyword to help construct a URL with query parameters #21

Open
ombre42 opened this issue Jul 2, 2013 · 3 comments
Open

Add keyword to help construct a URL with query parameters #21

ombre42 opened this issue Jul 2, 2013 · 3 comments

Comments

@ombre42
Copy link

ombre42 commented Jul 2, 2013

When using query parameters, various characters need to be 'percent-encoded'. This can be done manually when the parameters are known, but when constructing the URL from unknown inputs, a method must be used to do the encoding. urllib.urlencode provides encoding functionality.

@peritus
Copy link
Owner

peritus commented Jul 2, 2013

Yes, you're right. Care to submit a pull request ? Perhaps something similar to the JSON keywords (i. e. creating/parsing query-string <-> robot framework dictionaries) ?

@ombre42
Copy link
Author

ombre42 commented Jul 2, 2013

I will submit a pull request, but I want to get a new release of SudsLibrary done first. How does this look:
build_url(path, *key_value_pairs) where key_value_pairs can also be a dict. This makes the keyword easier to use for simple use cases.

${url}=    Build Url    /foo    type    checking account
# or
${param dict}=    Create Dictionary    type    checking account
${url}=    Build Url    /foo    ${param dict}

${url} would have value u'/foo?type=checking%20account'
URL here is not really a URL, but the part of the URL that you referred to as URL in other keywords such as POST.

@ShanthkumarS079
Copy link

ShanthkumarS079 commented Jun 7, 2016

can i pass ?(@.ABC || @.XYZ) in the http get request.
I tired it on my machine it's failing.

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

3 participants