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

Making printing of HttpRequest objects more informative? #128

Closed
maelle opened this issue Feb 26, 2020 · 4 comments
Closed

Making printing of HttpRequest objects more informative? #128

maelle opened this issue Feb 26, 2020 · 4 comments
Milestone

Comments

@maelle
Copy link
Member

maelle commented Feb 26, 2020

I was looking at HttpRequest objects, and am wondering whether it could be more visible when one such object has a query associated with it e.g.

query <- list(city = "Delhi", 
              date_from = "2020-02-25", 
              limit = 100, 
              include_fields = "", 
              page = 1)

req1 <- crul::HttpRequest$new(url = "https://api.openaq.org/v1/measurements")
req1
#> <crul http request> 
#>   url: https://api.openaq.org/v1/measurements
#>   curl options: 
#>   proxies: 
#>   auth: 
#>   headers: 
#>   progress: FALSE

req2 <- crul::HttpRequest$new(url = "https://api.openaq.org/v1/measurements")$get(query = query)
req2
#> <crul http request> get
#>   url: https://api.openaq.org/v1/measurements
#>   curl options: 
#>   proxies: 
#>   auth: 
#>   headers: 
#>   progress: FALSE

Created on 2020-02-26 by the reprex package (v0.3.0)

I'd expect req2 to show the query?

@sckott
Copy link
Collaborator

sckott commented Feb 26, 2020

thanks, having a look

@sckott sckott added this to the v1.0 milestone Feb 26, 2020
sckott added a commit that referenced this issue Feb 26, 2020
and work for handles as well which was broken
@sckott
Copy link
Collaborator

sckott commented Feb 26, 2020

@maelle let me know if that works for you now

@sckott sckott closed this as completed Mar 12, 2020
@maelle
Copy link
Member Author

maelle commented Mar 24, 2020

What, 27 days ago already?! Sorry for the delay Scott. It looks great, thank you!

query <- list(city = "Delhi", 
              date_from = "2020-02-25", 
              limit = 100, 
              include_fields = "", 
              page = 1)

req1 <- crul::HttpRequest$new(url = "https://api.openaq.org/v1/measurements")
req1
#> <crul http request> 
#>   url: https://api.openaq.org/v1/measurements
#>   curl options: 
#>   proxies: 
#>   auth: 
#>   headers: 
#>   progress: FALSE

req2 <- crul::HttpRequest$new(url = "https://api.openaq.org/v1/measurements")$get(query = query)
req2
#> <crul http request> get
#>   url: https://api.openaq.org/v1/measurements?city=Delhi&date_from=2020-02-25&limit=100&include_fields=&page=1
#>   curl options: 
#>   proxies: 
#>   auth: 
#>   headers: 
#>   progress: FALSE

Created on 2020-03-24 by the reprex package (v0.3.0)

@sckott
Copy link
Collaborator

sckott commented Mar 24, 2020

👍

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

2 participants