Hi Im trying to save media stream using RecorderEndpoint to remote server.
In Kurento java client doc, RecorderEndpoint supports post request.
"POST request will be used against a remote server. The server must support using the chunked encoding mode (HTTP header Transfer-Encoding: chunked)."
I fixed tiny parts in kurento-hello-world-recording tutorial.
-----------------------------------------------------------------------------
RecorderEndpoint recorder = new RecorderEndpoint.Builder(pipeline, RECORDER_FILE_PATH3)
.withMediaProfile(profile).build();
... same with tutorial
-> kms is installed in docker based on wsl2
-----------------------------------------------------------------------------
And this is my spring web server for receiving POST request
@RestController
@RequestMapping("/recording")
@PostMapping(value = "/", consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public ResponseEntity<String> mediaPost(@RequestBody InputStream recording) {
try {
System.out.println(" ----- post request -----");
return ResponseEntity.ok("Chunked encoding POST request received");
} catch (Exception e) {
return ResponseEntity.badRequest().build();
}
}
@PostMapping(value = "/{file}", consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public ResponseEntity<String> mediaPost2(@PathVariable("file") String file, @RequestBody InputStream recording) {
try {
System.out.println(" ----- post request -----");
System.out.println(file);
return ResponseEntity.ok("Chunked encoding MP4 POST request received");
} catch (Exception e) {
return ResponseEntity.badRequest().build();
}
}
both post controller doesn't work.
What's wrong with it?
Im really newbie about it :(
can you tell me some details about this problem?
thank you