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

Problems with UPDATE and INSERT #27

Closed
ticxx opened this issue Oct 30, 2012 · 7 comments
Closed

Problems with UPDATE and INSERT #27

ticxx opened this issue Oct 30, 2012 · 7 comments
Labels

Comments

@ticxx
Copy link

ticxx commented Oct 30, 2012

Hi,

on fresh setup: win7, tomcat 7.0.32, jdk 1.7.0, restsql 0.8.3
SELECT and DELETE works fine,
but on UPDATE and INSERT this error occurs:

Request:

PUT /restsql/res/Country/2 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/json

country=ff

Response:

HTTP/1.1 500 Internal Server Error
Content-Type: text/plain

No deserializer found for media type application/x-www-form-urlencoded; charset=UTF-8

For xml:
No deserializer found for media type application/xml; charset=UTF-8

For json:
No deserializer found for media type application/json; charset=UTF-8

thanks for help, ticxx

@restsql
Copy link
Owner

restsql commented Oct 30, 2012

Are you setting the charset in the media type? I don't think that will work. Just use the plain internet media type. I think utf-8 is returned anyway.

@restsql
Copy link
Owner

restsql commented Oct 30, 2012

Another effort I suggest is to setup the example DB and SDK. Open up the API explorer and it'll show you request and responses for any ops on a half dozen resources.

@ticxx
Copy link
Author

ticxx commented Oct 30, 2012

I used the example DB and SDK. The request and response are copy paste from the API explorer

@restsql
Copy link
Owner

restsql commented Oct 30, 2012

Which browser and version are you using. Perhaps it is appending the charset.

@ticxx
Copy link
Author

ticxx commented Oct 30, 2012

i' m using firefox 16.0.2. Tried the same with chrome 22.0.1229.94 and it works fine....
can you give me an explanation? Is this a general problem with firefox and restsql?

@restsql
Copy link
Owner

restsql commented Oct 30, 2012

You've found a bug. I didn't test the json enhancement with the API explorer and Firefox. I'll add Firefox to the explorer testing from now on.

This probably will impact any Firefox app accessing restsql.

I will look at fixing this as soon as I can.

@restsql
Copy link
Owner

restsql commented Nov 4, 2012

It's interesting that the mozilla team found the addition of the charset to the Content-Type header, when set using XHR.setRequestHeader(), many years ago but decided not to fix it.

https://bugzilla.mozilla.org/show_bug.cgi?id=416178

But it doesn't do that to the Accept header.

@restsql restsql closed this as completed in e650ce0 Nov 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants