Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Aug 17, 2023

Fixes #57

Not sure if the query interface should look more like resp_header()/resp_headers(), i.e. is it useful to provide a helper to extract a single query parameter and provide a default if it's not found?

@hadley hadley requested a review from mgirlich August 17, 2023 03:56

expect_equal(resp_url(resp), paste0(example_url(), "get?a=1&b=2"))
expect_equal(resp_url_path(resp), "/get")
expect_equal(resp_url_query(resp), list(a = "1", b = "2"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not really worth the complexity but this examples makes me wonder whether something like a ptypes argument would make sense. It would be nice to easily get list(a = 1, b = 2).

@mgirlich
Copy link
Collaborator

I think it would be nice to have resp_url_queries() and resp_url_query()

hadley and others added 3 commits August 24, 2023 08:29
@hadley hadley merged commit f28ec8a into main Aug 23, 2023
@hadley hadley deleted the resp_url branch August 23, 2023 20:49
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

Successfully merging this pull request may close these issues.

Extract query parameters

3 participants