Skip to content

Request headers in DELETE method #131

Open
@dioxine

Description

@dioxine

Hello. Thanx for so nice and powerfull product! A little nuance i'd like to observe. It wasn't really clear for me to get it work, until i look at code, cause the order definitely has meaning.
This one doesn't work:

const del = bent(
      "https://xxx.com/",
      "DELETE",
      "json",
      200,
      {
        authorization: `Bearer secretblablabla`,
      },
    );
const response = await del("sessions/sign_out");

but this one - works:

const del = bent(
      200,
      "DELETE",
      "json",
      {
        authorization: `Bearer secretblablabla`,
      },
      "https://xxx.com/"
    );
const response = await del("sessions/sign_out");

and headers object doesn't work in request if it looks like:

{  headers: 
    {  authorization: `Bearer secretblablabla`,  },
}

but it goes ok without "headers" wrapper!

maybe someone will find that info usefull

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