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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

ticxx commented Oct 30, 2012

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

@restsql

This comment has been minimized.

Copy link
Owner

restsql commented Oct 30, 2012

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

@ticxx

This comment has been minimized.

Copy link

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

This comment has been minimized.

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

This comment has been minimized.

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 in e650ce0 Nov 4, 2012

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