Unable to remove Content-Type header for POST request with empty body

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to remove Content-Type header for POST request with empty body

Keerthika Mahendralingam
Hi All,

Dropbox backend service expecting a POST request with empty body and without Content-Type header for download method[1]. 

I am unable to remove the Content-Type header from the request. Is there any way to do this?

I tried with the following:
<header name="Content-Type" scope="transport" action="remove"/>
It is working for GET methods but not for POST one.

If I use <property name="messageType" scope="axis2" value=""/>, content type is set as null but it is sending "<jsonObject/>" in the body.

Please find the configuration I used:

<?xml version="1.0" encoding="UTF-8"?>
       name="testProxy"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="https,http">
   <target>
      <inSequence>         
          <payloadFactory media-type="json">
              <format></format>
              <args></args>
          </payloadFactory>
          <property name="messageType" value="application/x-www-form-urlencoded" scope="axis2"></property>
          <property name="FORCE_POST_PUT_NOBODY" value="true" scope="axis2" type="BOOLEAN"></property>
          <call>
              <endpoint>
                    <http method="post" uri-template="https://content.dropboxapi.com/2/files/download"/>
              </endpoint>
         </call>
      </inSequence>
   </target>
   <description/>
</proxy>
        

Thanks,
--
[hidden email]
Keerthika Mahendralingam
Software Engineer
Mobile :+94 (0) 776 121144
WSO2, Inc. 
lean . enterprise . middleware 

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to remove Content-Type header for POST request with empty body

malakasilva
It seems to me we may not be able to do this use case for post requests with empty content.

@ESB Team - Let us know if there is a way to handle this?

On Wed, Nov 2, 2016 at 5:36 PM, Keerthika Mahendralingam <[hidden email]> wrote:
Hi All,

Dropbox backend service expecting a POST request with empty body and without Content-Type header for download method[1]. 

I am unable to remove the Content-Type header from the request. Is there any way to do this?

I tried with the following:
<header name="Content-Type" scope="transport" action="remove"/>
It is working for GET methods but not for POST one.

If I use <property name="messageType" scope="axis2" value=""/>, content type is set as null but it is sending "<jsonObject/>" in the body.

Please find the configuration I used:

<?xml version="1.0" encoding="UTF-8"?>
       name="testProxy"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="https,http">
   <target>
      <inSequence>         
          <payloadFactory media-type="json">
              <format></format>
              <args></args>
          </payloadFactory>
          <property name="messageType" value="application/x-www-form-urlencoded" scope="axis2"></property>
          <property name="FORCE_POST_PUT_NOBODY" value="true" scope="axis2" type="BOOLEAN"></property>
          <call>
              <endpoint>
                    <http method="post" uri-template="https://content.dropboxapi.com/2/files/download"/>
              </endpoint>
         </call>
      </inSequence>
   </target>
   <description/>
</proxy>
        

Thanks,
--
[hidden email]
Keerthika Mahendralingam
Software Engineer
Mobile :<a href="tel:%2B94%20%280%29%20776%20121144" value="+94776121144" target="_blank">+94 (0) 776 121144
WSO2, Inc. 
lean . enterprise . middleware 



--

Best Regards,

Malaka Silva
Senior Technical Lead
M: +94 777 219 791
Fax :94 11 2145300 
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
https://wso2.com/signature

Don't make Trees rare, we should keep them with care

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to remove Content-Type header for POST request with empty body

Keerthika Mahendralingam
Since it is a blocker for us I have created a JIRA ticket[1] for this.



Thanks,

On Fri, Nov 4, 2016 at 1:20 PM, Malaka Silva <[hidden email]> wrote:
It seems to me we may not be able to do this use case for post requests with empty content.

@ESB Team - Let us know if there is a way to handle this?

On Wed, Nov 2, 2016 at 5:36 PM, Keerthika Mahendralingam <[hidden email]> wrote:
Hi All,

Dropbox backend service expecting a POST request with empty body and without Content-Type header for download method[1]. 

I am unable to remove the Content-Type header from the request. Is there any way to do this?

I tried with the following:
<header name="Content-Type" scope="transport" action="remove"/>
It is working for GET methods but not for POST one.

If I use <property name="messageType" scope="axis2" value=""/>, content type is set as null but it is sending "<jsonObject/>" in the body.

Please find the configuration I used:

<?xml version="1.0" encoding="UTF-8"?>
       name="testProxy"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="https,http">
   <target>
      <inSequence>         
          <payloadFactory media-type="json">
              <format></format>
              <args></args>
          </payloadFactory>
          <property name="messageType" value="application/x-www-form-urlencoded" scope="axis2"></property>
          <property name="FORCE_POST_PUT_NOBODY" value="true" scope="axis2" type="BOOLEAN"></property>
          <call>
              <endpoint>
                    <http method="post" uri-template="https://content.dropboxapi.com/2/files/download"/>
              </endpoint>
         </call>
      </inSequence>
   </target>
   <description/>
</proxy>
        

Thanks,
--
[hidden email]
Keerthika Mahendralingam
Software Engineer
Mobile :<a href="tel:%2B94%20%280%29%20776%20121144" value="+94776121144" target="_blank">+94 (0) 776 121144
WSO2, Inc. 
lean . enterprise . middleware 



--

Best Regards,

Malaka Silva
Senior Technical Lead
M: <a href="tel:%2B94%20777%20219%20791" value="+94777219791" target="_blank">+94 777 219 791
Fax :94 11 2145300 
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
https://wso2.com/signature

Don't make Trees rare, we should keep them with care



--
[hidden email]
Keerthika Mahendralingam
Software Engineer
Mobile :+94 (0) 776 121144
WSO2, Inc. 
lean . enterprise . middleware 

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to remove Content-Type header for POST request with empty body

hmrajas1990
Hi All,

Since this is a blocker to our dropbox connector download method. I'm removing "<jsonObject/> "by adding below lines of code to detach the element before sending the request[1] and method work as expected[2]. is this ok?

On Mon, Nov 7, 2016 at 12:08 PM, Keerthika Mahendralingam <[hidden email]> wrote:
Since it is a blocker for us I have created a JIRA ticket[1] for this.



Thanks,

On Fri, Nov 4, 2016 at 1:20 PM, Malaka Silva <[hidden email]> wrote:
It seems to me we may not be able to do this use case for post requests with empty content.

@ESB Team - Let us know if there is a way to handle this?

On Wed, Nov 2, 2016 at 5:36 PM, Keerthika Mahendralingam <[hidden email]> wrote:
Hi All,

Dropbox backend service expecting a POST request with empty body and without Content-Type header for download method[1]. 

I am unable to remove the Content-Type header from the request. Is there any way to do this?

I tried with the following:
<header name="Content-Type" scope="transport" action="remove"/>
It is working for GET methods but not for POST one.

If I use <property name="messageType" scope="axis2" value=""/>, content type is set as null but it is sending "<jsonObject/>" in the body.

Please find the configuration I used:

<?xml version="1.0" encoding="UTF-8"?>
       name="testProxy"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="https,http">
   <target>
      <inSequence>         
          <payloadFactory media-type="json">
              <format></format>
              <args></args>
          </payloadFactory>
          <property name="messageType" value="application/x-www-form-urlencoded" scope="axis2"></property>
          <property name="FORCE_POST_PUT_NOBODY" value="true" scope="axis2" type="BOOLEAN"></property>
          <call>
              <endpoint>
                    <http method="post" uri-template="https://content.dropboxapi.com/2/files/download"/>
              </endpoint>
         </call>
      </inSequence>
   </target>
   <description/>
</proxy>
        

Thanks,
--
[hidden email]
Keerthika Mahendralingam
Software Engineer
Mobile :<a href="tel:%2B94%20%280%29%20776%20121144" value="+94776121144" target="_blank">+94 (0) 776 121144
WSO2, Inc. 
lean . enterprise . middleware 



--

Best Regards,

Malaka Silva
Senior Technical Lead
M: <a href="tel:%2B94%20777%20219%20791" value="+94777219791" target="_blank">+94 777 219 791
Fax :94 11 2145300 
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
https://wso2.com/signature

Don't make Trees rare, we should keep them with care



--
[hidden email]
Keerthika Mahendralingam
Software Engineer
Mobile :<a href="tel:+94%2077%20612%201144" value="+94776121144" target="_blank">+94 (0) 776 121144
WSO2, Inc. 
lean . enterprise . middleware 

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Thank you
Best Regards

Rajjaz HM

Software Engineer
Platform Extension Team
WSO2 Inc.
lean | enterprise | middleware
Mobile | +94752833834|+94777226874
Email   | [hidden email]

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev