Skip to content

Cannot post a body that is not an object #52

@j7m4

Description

@j7m4

I'm testing an existing XML-based rest API. The XML string is not sent with:
.post("/my/uri", "xml")

I looked into api-easy.js, and I think I see the issue. The _request function expects data to be an object. Fixing this would not be as simple allowing the body to be either an object or string -- as this could possibly conflict with the uri parameter.

One possible solution is to have the body continue to be an object, but for unkown mime types, encapsulate the data in an object, like such: {"body": "xml"}.

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