Skip to content

Conversation

Alan-Cha
Copy link
Collaborator

@Alan-Cha Alan-Cha commented Jul 1, 2020

Related to #325

Lionel Schiepers and others added 3 commits July 1, 2020 13:37
The HTTP Get operation actually set a content-type of 'application/json' when there is no payload. The request adds a content-length of 0 because there is no payload.

Web server like https://github.com/stoplightio/prism (mock of openapi) reject the calls because the content-type has nothing to do with GET operations.

Exemple:
GET http://127.0.0.1:4010/RESTMethod HTTP/1.1
content-type: application/json
accept: application/json
host: 127.0.0.1:4010
content-length: 0
Connection: close

Signed-off-by: Lionel Schiepers <[email protected]>
fix: check if there is a payload by checking the http method instead of payloadRequired because that field is not always correctly initialized during unit test
Signed-off-by: Lionel Schiepers <[email protected]>
@Alan-Cha Alan-Cha force-pushed the content-type-method branch from f5927ab to 71c239e Compare July 1, 2020 22:39
@lionelschiepers
Copy link

Thanks for this implementation :-)

@Alan-Cha Alan-Cha merged commit 4f3d8cb into IBM:master Jul 6, 2020
@Alan-Cha
Copy link
Collaborator Author

Alan-Cha commented Jul 6, 2020

@lionelschiepers Published! Try out v2.2.3!

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

Successfully merging this pull request may close these issues.

2 participants