7 Replies Latest reply on Apr 4, 2018 9:03 PM by Mathieu Rampant

    HTTP header is not set in invokeHTTP

    Sanjay Chaturvedi Novice

      Hi,

       

      I have a virtual proc to call a REST service, I successfully ran it in REST UI with header application/json as content type.

      In virtual proc I am passing headers value, but still in logs it is sending header as default i.e.

      [org.apache.cxf.transport.http.Headers] (Worker19_QueryProcessorQueue53) Content-Type: text/xml; charset=utf-8

      while in call, I am passing as application/json.

       

      I have tried following :

      changed headers to IN / INOUT parameter(by default it was out) pls confirm, if this is correct ?

       

      [org.apache.cxf.transport.http.Headers] (Worker19_QueryProcessorQueue53) Content-Type: text/xml; charset=utf-8

       

      EXEC invokeHttp(action => 'PUT', request => JSONOBJECT('{"select":{"from":["Country"]}}'),

      endpoint => 'http://y',

      headers=>'{"content-type":"application\/json;charset=UTF-8","accept":"application\/json"}',

      ContentType=>'application\/json',

      stream => TRUE) ;

       

      also tried giving

      headers=>'{"content-type":"application\/json;charset=UTF-8","accept":"application\/json"}',

      headers => JSONOBJECT('application/json' AS "Content-Type")

       

      but every time it is sending text/html as content type  which is resulting in 415 unsuppotred media type error.  Please suggest

       

      Thanks.