-
Couldn't load subscription status.
- Fork 6k
Closed
Labels
Milestone
Description
Description
Cpprest does not set the Content-Type header on POST requests and so the server rejects all POST requests from this language.
Swagger-codegen version
Latest master build.
Swagger declaration file content or url
Any POST command with Content-Type as application/json.
Command line used for generation
java -jar swagger-codegen-cli.jar generate -l cpprest -i -o src
Steps to reproduce
Run swagger-codegen for language cpprest with a YAML file with at least one POST method that takes a content type of application/json.
Related issues
None
Suggest a Fix
I have fixed this on my fork by adding the following line to the api-source.mustache file:
headerParams[U("Content-Type")] = requestHttpContentType;
I will issue a pull request shortly.