I am using mule 3.3.2. I want to set few headers in https request. In http:outbound-endpoint I use http:request-builder to add headers. But it doesn't work in https:outbound-endpoint.
Any help would beappreciated.
To add headers to https request, set-property tag works.
Related
I have exposed few response headers through mule unfortnately the clinet (browser ) unable to see or missing the resposne headers at client side. I really dont know what exactly i have to configure in mule for expose the custom header responses to browser.
I see in internet like this header can help me to fix the issue but im not sure and also i dont know how to define this header in mule side.
access-control-expose-headers
I have a requirement in my application where a header other than default one sent in http request should be suppressed. Right now in my application when i send a request i am able to attach custom header fields.
Is there a way in apache tomcat configuration settings which will suppress headers other than default ones ? , i tried checking few sites, i found how to remove headers in response
http://www.shanison.com/2012/07/05/unset-apache-response-header-protect-your-server-information/
Is there any similar solution to remove request headers?
Thanks in adv.
How to check the URL is http or https through programmatically using HttpServlet. If the Url is http send message as Warning otherwise message as Allow.
How to prevent HTTP Url and allow HTTPS through programmatically.
You can detect HTTPS inside a servlet via servletRequest.isSecure().
To force use of HTTPS, just configure secure Urls in your web.xml. The when users go to HTTP they will be redirected to HTTPS.
which java http client library is easy to use for programmatically doing posts, setting cookies and maybe ajax?
Apache HTTP Component (HttpClient 4.0),
http://hc.apache.org/httpcomponents-client-4.0.1/index.html
Normally, I would just use HttpURLConnection but its cookie handling is too weak to simulate browser behavior.
You can use JdkRequest from jcabi-http (I'm a developer), which does all this work for you, decorating HttpURLConnection, firing HTTP requests and parsing responses, for example:
new JdkRequest("http://www.google.com")
.header("Content-Type", "application/x-www-form-urlencoded")
.body()
.formParam("name", "John")
.back()
.method("POST")
.fetch();
Read this blog post for more details: http://www.yegor256.com/2014/04/11/jcabi-http-intro.html
Async request like AJAX:
http://hc.apache.org/httpcomponents-asyncclient-dev/
Sync request:
http://hc.apache.org/httpcomponents-client-4.0.1/index.html
Cookies is A kind of Header. Add cookies like A Header:
"Cookie: COOKIE_1=231412;COOKIE_2=234124"
It seems like the WebService(SOAP) Request of JMeter does not include headers in the request defined in a HTTP Header Manager.
I want to send Accept-Encoding: gzip, deflate with every SOAP request of my JMeter test - is there a way to achieve that?
The workaround for me was to use the SOAP/XML-RPC Request Sampler instead of the the WebService(SOAP) Request. This one sends the configured request headers to the server.
After that I found out that the incoming compressed response was not decompressed so I filed a bug at https://issues.apache.org/bugzilla/show_bug.cgi?id=48542 and created a patch. The bug is fixed in the trunk and should be included in the current nightly build.