Skip to content

How can I add "QueryStringParams" that are not url encoded? #3243

Answered by jcamiel
muffl0n asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @muffl0n

Parameters in [QueryStringParams] section are always url encoded. You could write the URl directly without the query section, but there is a parsing error if we want a request to https://www.example.com/index.html?foo={bar}:

GET https://www.example.com/index.html?foo={bar}
HTTP 400
$ hurl test.hurl
error: Parsing URL
  --> /tmp/url/url2.hurl:1:44
   |
 1 | GET https://www.example.com/index.html?foo={bar}
   |                                            ^ illegal character <{>
   |

The only way I see to do this is to "trick" the parser and use a variable in the URL:

GET https://www.example.com/index.html?foo={{var}}
[Options]
variable: var={bar}
HTTP 400

It's not pretty but it…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@muffl0n
Comment options

@jcamiel
Comment options

@muffl0n
Comment options

Answer selected by muffl0n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants