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

Canjs [can-connect/data/url] supports only "application/json" and "application/x-www-form-urlencoded". Other vendor sepcific contenType are not supported. #351

Open
abdulsmrehman opened this issue Sep 18, 2017 · 2 comments

Comments

@abdulsmrehman
Copy link

  • [ 1] Always

Description :
I want pass a vendor specific Media type on the request header , But can-connect/data/url supports only 2 media type "application/json" and "application/x-www-form-urlencoded" others are marked unsupported and the default content type["application/json"] is used, when any unsupported type is passed .

var connection = persist({
url: {
createData: "POST /api/restaurants",
contentType: "application/vnd.vendorspecific-v1+json"
}
});

Is there a way that i can override findContentType of url.js which actually does this validation and returns default "application/json" type. Please provide your suggestion on how to tackle this,

Software Version
can-connect version 1.4.1
Browser chrome
Operating system Windows
@abdulsmrehman abdulsmrehman changed the title Canjs supports only "application/json" and "application/x-www-form-urlencoded". Other vendor sepcific contenType are not supported. Canjs [can-connect/data/url] supports only "application/json" and "application/x-www-form-urlencoded". Other vendor sepcific contenType are not supported. Sep 18, 2017
@chasenlehara
Copy link
Member

For reference, here’s where this question was asked and @jeroencornelissen & @ivospinheiro helpfully provided a workaround: https://gitter.im/canjs/canjs?at=59bfa1b5cfeed2eb652288b1

@ivospinheiro
Copy link

Can this configuration be added to the can-connect url behavior?

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

No branches or pull requests

4 participants