tomas / needle

Nimble, streamable HTTP client for Node.js. With proxy, iconv, cookie, deflate & multipart support.
https://www.npmjs.com/package/needle
MIT License
1.63k stars 236 forks source link

captialized 'GET' is not accepted as a readable verb #364

Closed erf closed 3 years ago

erf commented 3 years ago

captialized 'GET' is not accepted as a readable verb, so it expected a "data" object.

I would think you could write:

    const res = await needle('GET', uri, params)

where, params has a header with authentication, but this fails

instead i have to write:

    const res = await needle('get', uri, params)

I would think http verbs "get" and "GET" were case-insensitive, as per standard

tomas commented 3 years ago

Yes I think you're right. We should change this. Do you have time to submit a PR?