Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Request and Response handling #46

Merged
merged 16 commits into from
Aug 23, 2024
Merged

Conversation

MattCCC
Copy link
Owner

@MattCCC MattCCC commented Aug 23, 2024

Features:

  • more strongly typed query params in fetchf() requests by default
  • passed params can handle array of objects with "name" and "value" properties

Docs:

  • updated coverage information

Fixes:

  • don't attempt to serialize body payload if URLSearchParams are passed
  • correctly parse "params" property passed in Request Config
  • fetchf() wrapper should not make assumptions regarding request data/params
  • more predictable body/data parsing inline with native fetch()
  • correctly append query params to POST requests, if data/body are specified
  • correctly handle charset in the content type headers when parsing response data
  • bail parsing data early if there is no response body
  • correctly parse text/ responses and streams
  • normalize headers keys to lowercase as per IETF RFC 2616 4.2
  • distingiush versions loaded by node and browsers

Copy link

github-actions bot commented Aug 23, 2024

size-limit report 📦

Path Size
dist/browser/index.mjs 2.68 KB (+0.26% 🔺)
dist/browser/index.global.js 0 B (+100% 🔺)

test/request-handler.spec.ts Dismissed Show dismissed Hide dismissed
test/request-handler.spec.ts Dismissed Show dismissed Hide dismissed
test/request-handler.spec.ts Dismissed Show dismissed Hide dismissed
test/request-handler.spec.ts Dismissed Show dismissed Hide dismissed
@MattCCC MattCCC merged commit 2847456 into master Aug 23, 2024
9 checks passed
@MattCCC MattCCC deleted the improve-req-res-parsing branch August 23, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant