Skip to content

Extract query parameters #57

@mgirlich

Description

@mgirlich

I spend a few minutes to try out httr2. Great work with the new oauth system. I didn't really managed to use oauth with httr but it only took me two minutes to make it work in httr2 😄

I want to extract the url query paramters of a request and wondered whether there is an easier way than the following

library(httr2)
req <- request("https://example.com/path/to/page?name=ferret&color=purple")

req_queries <- url_parse(req$url)$query
req_queries$name
#> [1] "ferret"

Created on 2021-07-29 by the reprex package (v2.0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions