json - 411 Response on Post from WSO2 API Manager to REST endpoint -


i have setup rest endpoint in wso2 calls out rest endpoint. when call made receiving 411 response code. request contains json body, content type , accepts header set application/json. can curl backing service wso2 accessing directly same params , works correctly. seems wso2 stripping or not sending content-length.

why content length not being sent rest endpoint being accessed?

sending content-length disabled default because can cause performance degradation. can enable adding following api's insequence. (see https://docs.wso2.com/display/am1100/adding+mediation+extensions on adding custom sequence api)

<property name="copy_content_length_from_incoming" value="true" scope="axis2"/> <property name="force_http_content_length" scope="axis2" value="true"></property> 

following sample sequnce

<sequence xmlns="http://ws.apache.org/ns/synapse" name="contentlengthadd">     <property name="copy_content_length_from_incoming" value="true" scope="axis2"/>     <property name="force_http_content_length" scope="axis2" value="true"></property> </sequence> 

this sequence content length incoming request request , pass request header backend.

you can read more these 2 properties in https://docs.wso2.com/display/esb481/http+transport+properties#httptransportproperties-force_http_content_length


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -