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

Support query parameters directly in URL #95

Open
finestructure opened this issue Apr 29, 2020 · 1 comment
Open

Support query parameters directly in URL #95

finestructure opened this issue Apr 29, 2020 · 1 comment

Comments

@finestructure
Copy link
Owner

finestructure commented Apr 29, 2020

I can't believe this is the case but apparently I'm stripping off query parameters somewhere:

requests:
    test:
        url: "http://httpbin.org/anything?foo=bar"
        validation:
            status: 200
        log: json

results in:

🎬  test started ...

JSON: ["url": "http://httpbin.org/anything", "json": null, "method": "GET", "origin": "195.12.50.238", "form": [:], "data": "", "headers": ["Host": "httpbin.org", "User-Agent": "rester (unknown version) CFNetwork/1125.2 Darwin/19.4.0 (x86_64)", "Accept": "*/*", "Accept-Language": "en-gb", "Accept-Encoding": "gzip, deflate", "X-Amzn-Trace-Id": "Root=1-5ea95d5d-d343e690f115969c2b4ca184"], "files": [:], "args": [:]]

i.e.

"args": [:]

should be:

"args": ["foo": "bar"]
❯ http "http://httpbin.org/anything?foo=bar"
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 412
Content-Type: application/json
Date: Wed, 29 Apr 2020 10:55:33 GMT
Server: gunicorn/19.9.0

{
    "args": {
        "foo": "bar"
    },
    "data": "",
    "files": {},
    "form": {},
    "headers": {
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate",
        "Host": "httpbin.org",
        "User-Agent": "HTTPie/2.1.0",
        "X-Amzn-Trace-Id": "Root=1-5ea95d25-e3e4dab0a924f19c855e106c"
    },
    "json": null,
    "method": "GET",
    "origin": "195.12.50.238",
    "url": "http://httpbin.org/anything?foo=bar"
}
@finestructure
Copy link
Owner Author

Well, actually it's supported, just not in an obvious way 😅

requests:
  repos:
    url: ${api_url}/projects/${project_id}/pipelines
    query:
      status: running
      page: 1
      per_page: 20

@finestructure finestructure changed the title Query parameters? Support query parameters directly in URL Jan 26, 2021
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

1 participant