HTTP Direct Basic - change Content-Type used to send the req

Posted by paul.ungureanu on 18-Apr-2012 00:02

  I have to comunicate with a HTTPS server that is waiting the messages with Content-Type=application/x-www-form-urlencoded; charset=UTF-8.

Now is sending the messages with Content-Type=text/plain.

[12/04/16 16:11:09] ID=MG_Brk01 (trace) Delivered HTTP Direct outbound message, containing details...
                Destination URL=https://192.168.200.42:8080/ProvisionServlet
                User=super
                Status Code=400
                [req]Content-Length=479
                [req]Content-Type=text/plain
                [resp]Content-Length=1061
                [resp]content-language=en-us
                [resp]connection=close

I'm using a Http Direct Basic routing definition to send the requests by calling ep.call

How I can  change the Content-Type that is used to send the messages?

All Replies

Posted by Bill Wood on 26-Oct-2013 15:13

You need to do a little more than change the Content-Type, because it does need to actually change the content to a string of bytes that is URLEncoded....

But assuming you do that, then the default behavior for HTTP Direct is to pass the JMS Headers as HTTP Headers.  Setting a property (and I believe Content-Type is one this will work for) in the JMS message should pass this through to the HTTP message.

This thread is closed