Skip to content

Error with content() for JSON response #330

@loganlinn

Description

@loganlinn

I am getting an error with latest httr version when calling content on a JSON response. Here's a small reproduction:

> httr::content(
+   httr::GET("https://status.github.com/api/status.json", encoding="UTF-8"),
+   type = "application/json",
+   simplifyVector = TRUE
+ )
Error in simplify(obj, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame,  :
  unused argument (encoding = NULL)

The error will actually go away if I don't use simplifyVector argument. But I think the real issue is lies in this change: f0fc278#diff-de09a71ef56d7758b0d08b98fe0520eaL68

The encoding argument was removed from function signature and now gets passed to jsonlite::fromJSON. If I put encoding = NULL back in that signature, ie removing it from ..., I no longer get the error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions