Code: Select all
@Operation(summary = "OData service exposed by it.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Service is running.",
content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = String.class))}),
@ApiResponse(responseCode = "500", description = "Internal server error.",
content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ErrorDetails.class))})})
@RequestMapping(value = "**")
void process(HttpServletRequest request, HttpServletResponse response) throws IOException {
if (request.getInputStream().available() > 0) {
System.out.println("Input Stream data present");
}
}
< /code>
Ich führe meinen API -Anruf von Postman wie unten aus: < /p>
curl --location --request POST 'http://localhost:8084/api/v1/inv/$batch' \
--header 'Content-Type: multipart/mixed;boundary=abc123;' \
--data-raw '--abc123
Content-Type: application/http
Content-Transfer-Encoding: binary
GET http://localhost:8084/api/v1/inv/Port_Type HTTP/1.1
--abc123
Content-Type: application/http
Content-Transfer-Encoding: binary
GET http://localhost:8084/api/v1/inv/Device_Type HTTP/1.1
--abc123--
'
Hier ist der aktualisierte Code:
Code: Select all
public void process(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
BufferedReader reader = request.getReader();
}