In our admin portal for one of our one microservice in code we gave 204 status but wso2 was not able to read that and shows 500 Internal Server Error.So when we changed in the code 204 to 404 wso2 was able to read it and stopped showing that error. So what can we do to resolve this 204 status from wso2 side?

 

TargetHandler ERROR_CODE = 101506, STATE_DESCRIPTION = Exception occurred after Server written the request headers and the request body to the backend, showing this error ERROR - TargetHandler HTTP protocol violation : Not a valid protocol version: {"status":"NO_CONTENT","message":"Job data not found","code":1107}HTTP/1.1 204 No Content For rg.apache.synapse.transport.http.conn.LoggingNHttpClientConnection$LoggingNHttpMessageParser.parse(LoggingNHttpClientConnection.java:404) ~[synapse-nhttp-transport_2.1.7.wso2v183.jar:?]

1

There are 1 best solutions below

0
ycr On

An HTTP 204 response cannot have a response body. This is an HTTP spec violation.

A 204 response is terminated by the end of the header section; it cannot contain content or trailers.

Hence try removing the response body from the response.