hoppscotch / hopp-cli

🤖 HTTP CLI client for https://hoppscotch.io
https://hoppscotch.io
MIT License
176 stars 24 forks source link

Include arbitrary headers with a request #43

Closed gbmor closed 2 years ago

gbmor commented 2 years ago

This allows any arbitrary header to be set for a given request. As an example, many HTTP APIs, particularly commercial HTTP APIs, require opaque authentication tokens to be set in the headers, instead of the more familiar bearer tokens.

Added the following flag:

Must be in the text format key: value and can be specified multiple times to include multiple headers.

Example request:

$ hopp-cli get -H 'X-Api-Key: foobar' -H 'X-Api-Secret: super_secret' https://example.com/api/v1/accounts
athul commented 2 years ago

Hey @gbmor there seems to be a conflict from the main branch. If you could resolve it too would be great 😄

gbmor commented 2 years ago

@athul resolved (it was the changes to README.md in this and my other PR you just merged)