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

Only json.stringify when the content type is application/json #16

Open
Nehon opened this issue May 2, 2016 · 0 comments
Open

Only json.stringify when the content type is application/json #16

Nehon opened this issue May 2, 2016 · 0 comments

Comments

@Nehon
Copy link

Nehon commented May 2, 2016

Hey really nice library you have here.

I stumbled on an issue though and figured out that the body (added with @Body) is always passed to JSON.stringify(). It's a problem when you want to send something that is not json.
https://github.com/Paldom/angular2-rest/blob/master/angular2-rest.ts#L192

It's very convenient of course when you want to send JSON, which is the case most of the time. But IMO this process should only be done when the content type is set to application/json.

It would be awesome to support any other content type encoding...but quite cumbersome, so I suggest to let the user format the body the way he wants when the content type is not application/json.

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

No branches or pull requests

1 participant