client: remove support for custom request Content-type #337
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.
GET requests do not have a content, so no content-type header needed.
POST requests, in theory, could have any content-type since users could use any kind of express middleware that would populate req.body. The only use case that I see is to upload pictures. One could use a multipart form data to do that. But this person would need to know fetchr middleware implementation in order to make it work properly. But I bet that we all know better options to upload media that would be easier than to hack fetchr.
So, IMO, it doesn't make sense to provide this feature. Am I missing something?
What I'm trying to do now is to make the requests/responses as consistent as possible so we can simplify the code. I'm mainly concerned about error handling, this is where the code here is the ugliest IMO. The error object is inconsistent for different kinds of errors. This makes it hard to build proper errors handlers (ex. an integration with newrelic, sentry or any custom error dashboard).
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.