cli icon indicating copy to clipboard operation
cli copied to clipboard

Default headers by domain

Open ohshazbot opened this issue 2 years ago • 1 comments

Checklist

  • [X ] I've searched for similar feature requests.

Enhancement request

I would like the ability to configure a default set of headers to use on a per domain basis, such that if I make a request against a domain, the headers per my configuration get included without me having to adjust the CLI command …


Problem it solves

I'm working on a project where we are currently playing with a few different domains. I have a different set of credentials for the different domains, so whenever I am exercising an API, I have to muck around with both the domain URL as well as the headers I'm including. I would love to streamline the amount of things I have to muck with to change the target of my request and I think the best way to do this would be the ability to specify headers on a per-domain basis in my config file.

I am open to alternatives, but for me it boils down to trying to widdle down modifying a domain + header to modifying a single value for me to retarget a request (including updating the credentials I shouldbe using)


Additional information, screenshots, or code examples

Currently requests look like this http get http://0.0.0.0:6543/staging/7 "x-ob-api: $LOCAL_API_KEY" and http get https://devapi.domain.com/staging/618 "x-ob-api: $DEV_API_KEY" and I would like to be able to so something as straightforward as http get http://0.0.0.0:6543/staging/7 (with appropriate configuration). If there's a desire for something more encompassing or to get away from concerns with domain parsing (I don't think there is, but just in case) something like http get --domain dev /rest/of/path could be an option, but I think the rest of the url starts to get a bit weird there, but could be just me. …

ohshazbot avatar Oct 30 '23 18:10 ohshazbot

Looks like 1568 might share the same solution. We should be able to provide a static set of headers in the config to be used per site.

aroraprince avatar Jun 10 '24 15:06 aroraprince