Skip to content

Implement a fetch_raw option, only_supports_raw instead of only_supports_classic #32

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

Closed
brookslogan opened this issue Apr 28, 2022 · 3 comments
Labels
P3 very low priority

Comments

@brookslogan
Copy link
Contributor

The endpoints marked with only_supports_classic = TRUE, such as meta, were designed in the original Epidata interface that received JSON and parsed it into a nested list structure. Changing only_supports_classic to only_supports_json or only_supports_classic_and_json prevents some strange print output on the nested data frames (and may allow an easier transition for those using the original Epidata, although there are probably not many/any active human users at this point).

@brookslogan brookslogan added the P3 very low priority label Sep 30, 2022
@brookslogan
Copy link
Contributor Author

fetch_json doesn't actually do what I expected. It doesn't take the json and just convert it to an R object; it tries for a data frame. And fetch_classic also tries to do the same. So some of these old endpoints may not output anything very nice for either fetch_classic or fetch_json. We may need something different for them.

@brookslogan
Copy link
Contributor Author

Another test case where we want "raw" format rather than "classic":

ec_old = Epidata$delphi("ec", 201501)
ec = delphi("ec","201501") %>% fetch_classic()

It looks like the difference is due to content(res, 'parsed') vs. r <- httr::content(res, "text", encoding = "UTF-8") then m <- jsonlite::fromJSON(r).

@brookslogan brookslogan changed the title Change only_supports_classic to also/only support JSON, or improve printing of classic response Implement a fetch_raw option, only_supports_raw instead of only_supports_classic Apr 11, 2023
@dshemetov
Copy link
Contributor

Closed by #99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 very low priority
Projects
None yet
Development

No branches or pull requests

2 participants