HttpClient Content-Type may not always be set
@@ -96,7 +96,7 @@ public HttpResponse execute(HttpRequest request, boolean followRedirects) throws
break;
case POST:
- String rawType = Optional.of(request.getHeader("Content-Type"))
+ String rawType = Optional.ofNullable(request.getHeader("Content-Type"))
.orElse("application/json; charset=utf-8");
MediaType type = MediaType.parse(rawType);
RequestBody body = RequestBody.create(type, request.getContent());
