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

Importer rest API Create import ContentType: application/json does not support charset #104

Open
mathieulavallee opened this issue Mar 15, 2016 · 0 comments

Comments

@mathieulavallee
Copy link

Hi, I am using the importer plugins rest API to add new geodata to geoserver.

According to The documentation:
When I create a new import using a POST on URL geoserver/rest/imports/ with a content-Type like

Content-Type : application/json

I specify my import workspace like so

{"import":{
    "targetWorkspace":{"workspace":{"name":"my_work_space"}}
    }
}

and the return the confirmation of the workspace like so

{
"import": {
...
    "targetWorkspace": {
      "workspace": {
        "name": "my_work_space"
      }
    },
}
}

I found a bug when using the Java apache HTTPClient and setting Content type to the preDefined ContentType.APPLICATION_JSON which set the content type to "application/json; charset=UTF-8". When I use the predefined contentType, I get no targetWorkspace confirmation and the import use the default workspace.

I did not look at the code, but I am suspecting a code that look specificaly for "application/json" since even adding ";" like application/json; does not work.

I also suspect other function to fail supporting charset.

here is the rfc for Content-type
https://www.w3.org/Protocols/rfc1341/4_Content-Type.html
https://www.w3.org/International/articles/http-charset/

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