Skip to content

Sending body and headers in a request #54

@serkolch

Description

@serkolch

Hey,

So I ran into this problem earlier: if you use a function other than .request(), you are not able to successfully send a request that contains headers and a body.

E.g. the below will not send a successful request

requestify.post(URL, {
    body: {data: AA},
    headers: {token: BBBB}
})

In order to send a successful request with both body and headers (and likely other attributes you may want), you need to send:

requestify.request(URL, {
    method: 'POST',
    body: {data: AA},
    headers: {token: BBBB}
})

Posting this here in case there is already a solution on the way or someone else runs into the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions