Feature/response encoding - #81
Merged
Merged
Conversation
Contributor
|
👋 Thanks for your contribution, @NEFORCEO! Please make sure:
Maintainers will review it soon. |
Contributor
Merging this PR will improve performance by 36.99%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_response_req_text_from_json |
213.2 µs | 134.8 µs | +58.16% |
| ⚡ | test_response_repr |
196.4 µs | 132.1 µs | +48.65% |
| ⚡ | test_response_property_access |
194.5 µs | 131.9 µs | +47.43% |
| ⚡ | test_response_json_parsing |
205.6 µs | 141.2 µs | +45.53% |
| ⚡ | test_response_creation |
201.3 µs | 140 µs | +43.8% |
| ⚡ | test_middleware_after_response |
403.1 µs | 355.6 µs | +13.35% |
| ⚡ | test_response_json_parsing_large_payload |
666.7 µs | 605.6 µs | +10.09% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feature/response-encoding (de2855b) with master (6f3d441)1
Footnotes
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
Add missing
httpx.Responsemetadata properties anddefault_encodingsupport toFastHTTP.Response
history— list of intermediate redirect responseselapsed—datetime.timedeltawith request timinghttp_version— protocol version string (HTTP/1.1,HTTP/2)reason_phrase— status text (OK,Not Found)is_success,is_redirect,is_error,is_client_error,is_server_error,is_informational— boolean status classifiersraise_for_status()— raisesFastHTTPBadStatusErroron 4xx/5xxFastHTTP
default_encodingparameter — controls response text decoding when charset is missingDefaultEncoding (Literal[...]) | Callable[[bytes], str]DefaultEncodingextracted tofasthttp/types.py🧩 Type of Change
✅ Checklist
🔗 Related Issues
—
📸 Additional Context
All 106 existing tests pass.
Usage examples