Added support for setting headers and overriding or extending the default Faraday connection block before a connection is constructed. #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From the updated README:
By default, Hyperclient adds
application/json
asContent-Type
andAccept
headers. It will also send requests as JSON and parse JSON responses. Specify additional headers or authentication if necessary.By default, Hyperclient constructs a connection using typical Faraday middleware for handling JSON requests and responses. You can specify additional Faraday middleware if necessary.
You can build a new Faraday connection block without inheriting default middleware by specifying
default: false
in theconnection
block.You can modify headers or specify authentication after a connection has been created. Hyperclient supports Basic, Token or Digest auth as well as many other Faraday extensions.
You can access the Faraday connection directly after it has been created and add middleware to itpoint. As an example, you could use the faraday-http-cache-middleware.