Document how to handle non-hal+json responses - #320
Merged
Conversation
Danger ReportNo issues found. |
Addresses codegram#134: by default, Hyperclient requires a Content-Type of application/hal+json and raises InvalidRepresentationError otherwise. This documents the existing workaround (broadening the response middleware's content_type matcher to /\bjson$/ via a custom connection block with default: false), confirmed working by the issue reporter.
dblock
force-pushed
the
dblock/doc-non-hal-json-responses
branch
from
August 26, 2026 21:45
4ba2743 to
f2c2964
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Addresses #134.
By default, Hyperclient requires responses to have a
Content-Typeofapplication/hal+json, raisingHyperclient::InvalidRepresentationErrorotherwise. This came up in #134, where an API returned a201 Createdwith an empty body and no matching content type on a_post.The reporter confirmed a working workaround using a custom Faraday connection with a broadened
content_typematcher:This documents that workaround right next to the existing (very similar)
default: falsecustom connection example in the README, so it's discoverable without having to dig through issues.Checklist