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

Endpoint "/v1/commands/network/create empty" fails with "application/xml" (offered in Swagger) #55

Closed
krassowski opened this issue Feb 27, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@krassowski
Copy link

Here is the generated curl command:

curl -X POST --header 'Content-Type: application/xml' --header 'Accept: text/html' 'http://localhost:1234/v1/commands/network/create empty'

And here is the error:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 415 Unsupported Media Type</title>
</head>
<body><h2>HTTP ERROR 415</h2>
<p>Problem accessing /v1/commands/network/create%20empty. Reason:
<pre>    Unsupported Media Type</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                
<br/>                                                

</body>
</html>

It works fine with "application/json".

@dotasek
Copy link
Contributor

dotasek commented Feb 27, 2018

Try replacing your spaces with %20

Spaces are usually handled automatically within web browsers, but not so in the console.

I can confirm the following works on my setup:

curl -X POST --header 'Content-Type: applicaion/json' --header 'Accept: application/json' -d '{}' 'http://localhost:3334/v1/commands/network/create%20empty'

@krassowski
Copy link
Author

I am sorry but I think that you are wrong. It's not a space or curl issue - no duplicates here ;)

Please have a look at my recording (25 sec):
ezgif-2-1936c52ce1

Also your confirmation shows curl with application/json, not with application/xml.

@bdemchak
Copy link

bdemchak commented Feb 27, 2018 via email

@dotasek dotasek reopened this Feb 27, 2018
@dotasek
Copy link
Contributor

dotasek commented Feb 27, 2018

Ah, I missed the detail of 'Content-Type: application/xml' specification. Thanks for being insistent. I'll take a look and see if I can disable xml content type for the Swagger documentation.

@dotasek
Copy link
Contributor

dotasek commented Feb 27, 2018

Addressed in 87063b3

Awaiting release.

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

3 participants