question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add custom headers option to CLI

See original GitHub issue

When used as a library, OASGraph allows to define custom headers to be sent in every HTTP request to the wrapped REST(-like) API, as described in the [options]{https://github.com/strongloop/oasgraph/tree/master/packages/oasgraph#options}.

However, this feature is not available when using OASGraph via CLI. A new headers option should allow users to define custom headers to send, for example, authentication tokens. This was also brought up in issue #88.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gtamascommented, Jul 18, 2019

@Alan-Cha I think it’s common, yes. For example this is how cURL works and several command-line parser libs support this as well (e.g: yargs, commander, optimist etc ). Also, specifying the header’s value in this format is quite common.

By the way, you could add support for defining query string parameters the same way. Like --qs foo:1 --qs bar: 2

Viewers: ok thx. Unfortunately that’s not gonna work in my case. I need to send custom things like sessionToken, username etc. Anyway,I already solved this. I used OtG as a lib instead of CLI.

0reactions
Alan-Chacommented, Jul 17, 2019

@gtamas Thank you so much for the insight! I will look into adding this feature then. Glad to hear that you were still able to solve your authentication problem!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I send Custom Headers with Curl? - ReqBin
You can pass multiple custom HTTP headers to Curl by repeating the -H "header: value" command line option. Click Run to execute the...
Read more >
HTTP headers - HTTPie 3.2.1 (latest) docs
To set custom headers you can use the Header:Value notation. ... You can customize the output with the usual output options, with the...
Read more >
How to add custom header in ZAP and zap-cli - HAHWUL
(Actually Burp and other use scanners tend to be somewhat similar.) So today I'm going to organize how you can use custom headers...
Read more >
Custom headers - AWS Amplify Hosting
Custom HTTP headers enable you to specify headers for every HTTP response. Response headers can be used for debugging, security, and informational purposes....
Read more >
Custom Headers with CLI Deployment Events
Simply add the --http-headers flag followed by the desired headers to your deployment CLI command. Sample use cases include: Setting tracking IDs on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found