Skip to content

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

Description

@Nehon

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions