Skip to content

http-server-js - support optional request bodies #7677

@chrisradek

Description

@chrisradek

Related to #6561

For some tests that make a post request with an empty request body, the contentType is not being set.

Example test:

uri: "/parameters/body-optionality/optional-explicit/omit",
method: "post",
request: {},
response: {
status: 204,
},

However the current http-server-js emitted code will only run the generated handler for the above scenario if the content-type is present and set to application/json.

I'd expect that when the request body is optional, the content-type header may be optional when the body is not provided.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions