-
Notifications
You must be signed in to change notification settings - Fork 5
Allow body transfer encoding overrides #1228
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
Allow body transfer encoding overrides #1228
Conversation
src/api/RestAPI.ts
Outdated
bodyTransferEncoding === "entity" | ||
? true && ![HTTPMethod.GET, HTTPMethod.HEAD].includes(method) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per specification GET and HEAD can never have a payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the true &&
part here? 🤔
? true && ![HTTPMethod.GET, HTTPMethod.HEAD].includes(method) | ||
: bodyTransferEncoding === "message" | ||
? false | ||
: ![HTTPMethod.GET, HTTPMethod.HEAD, HTTPMethod.DELETE].includes(method); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sneakily added HEAD in the default cases as it was missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🙇
I'll not use it at this time, but whenever I may use this
@YusukeFukushima Yeah. It is best not to use a body for the delete call method as it is not recommended. This if for customer who do not have the choice given their API. |
src/api/RestAPI.ts
Outdated
/** | ||
* Overrides default body transfer encoding of the request. | ||
* | ||
* Note: Can not for for GET and HEAD request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot
and remove duplicate for
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups. Thanks.
src/api/RestAPI.ts
Outdated
bodyTransferEncoding === "entity" | ||
? true && ![HTTPMethod.GET, HTTPMethod.HEAD].includes(method) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the true &&
part here? 🤔
minor comments..lgtm! |
Indeed, the true was not necessary, thanks for catching this 🙂 |
thanx! merging! |
It was asked for the services multiple time and backend was changed but it is only a matter of time before customer want to do the same as the web specifications allow for pretty wild usage.