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

Client simply not posting provided data #998

Closed
Robbilie opened this issue Apr 6, 2017 · 3 comments
Closed

Client simply not posting provided data #998

Robbilie opened this issue Apr 6, 2017 · 3 comments

Comments

@Robbilie
Copy link
Contributor

Robbilie commented Apr 6, 2017

Swagger("https://esi.tech.ccp.is/latest/swagger.json")
  .then(client => client.apis.Universe.post_universe_names({ ids: [99005843] }));

now this is a post request, pasting [99005843] here : https://esi.tech.ccp.is/latest/#!/Universe/post_universe_names

yields the correct result, if you check the response in browser of the above code or go to http://petstore.swagger.io/ and use https://esi.tech.ccp.is/latest/swagger.json as the spec url you will realize it not working, the posted body is empty.

@Robbilie
Copy link
Contributor Author

Robbilie commented Apr 6, 2017

moving on:
https://github.com/swagger-api/swagger-js/blob/master/README.md
search the readme for "addPet", copy & paste code and try to run it with:
http://petstore.swagger.io/v2/swagger.json

result:
Required parameter body is not provided

putting the body like it would be correct into an object with key body and value the value, as an object it returns:
415 (Unsupported Media Type)

cause no content-type nor body is sent

@webron
Copy link
Contributor

webron commented Apr 19, 2017

@Robbilie can you take a look at #1006? I suspect it's a duplicate of it.

@Robbilie
Copy link
Contributor Author

Robbilie commented Apr 19, 2017

looked at it for 2 seconds and remembered: i tried "serializing" useing JSON.stringify but the result was that it was posted with content-type text and not json so it broke

EDIT: how does he explicitly set the content-type header…?

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

2 participants