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

Fix method for "get", "post", "put", "patch" and "del" request creators #332

Closed
StefanoMagrassi opened this issue Dec 10, 2020 · 0 comments · Fixed by #335
Closed

Fix method for "get", "post", "put", "patch" and "del" request creators #332

StefanoMagrassi opened this issue Dec 10, 2020 · 0 comments · Fixed by #335
Assignees
Milestone

Comments

@StefanoMagrassi
Copy link
Contributor

Description

Currently the main module (src/index.ts) exposes 5 request creators with method already set (get, post, put, patch and del) using an internal combinator (setMethod).

This combinator suffers of the same bug of #328: the method wont be overwritten by subsequent combinators or provided RequestInit.

Current behavior

appy.post(['http://some.endpoint'], {method: 'GET'}) ignores method in RequestInit always sending request as POST

Expected behavior

appy.post(['http://some.endpoint'], {method: 'GET'}) should send request as GET

Environment:

  • OS: all
  • Browser: all
  • Node/npm version: all
  • Typescript version: all

Additional information

We can take advantage of this fix to expose a new combinator withMethod that can be used by the lib's consumers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant