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

Inconsistency of HttpRequest interface factory methods #5195

Closed
2 of 4 tasks
vonZeppelin opened this issue Mar 31, 2021 · 1 comment
Closed
2 of 4 tasks

Inconsistency of HttpRequest interface factory methods #5195

vonZeppelin opened this issue Mar 31, 2021 · 1 comment
Labels
info: good first issue Good for newcomers type: improvement A minor improvement to an existing feature

Comments

@vonZeppelin
Copy link

vonZeppelin commented Mar 31, 2021

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create POST or PUT or PATCH HttpRequest instance via corresp. static method with null as body.

Expected Behaviour

It is possible to create a POST / PUT / PATCH HttpRequest instance with null body via interface factory methods. Use-case for this is to make sending of the POST / PUT / PATCH request with empty body via, for example, RxHttpClient possible. A workaround is to use empty string as body or build the request with HttpRequest.create() (?).

Actual Behaviour

NullPointerException Argument [body] cannot be null will be thrown. DELETE instance can be created with null body though.

Notes

HttpRequest.getBody() returns Optional, so enforcing non-null bodies looks excessive.

Example Application

Not required, issue is obvious from the source code.

@graemerocher graemerocher added type: improvement A minor improvement to an existing feature info: good first issue Good for newcomers labels Apr 14, 2021
@vonZeppelin
Copy link
Author

This is fixed in Micronaut 2.5.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info: good first issue Good for newcomers type: improvement A minor improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants