Fiddler Dynatrace integration - fiddler

I added request header in fiddler by using the syntax below:
oSession.oRequest["NewHeaderName"] = "New header value";
Ex: oSession.oRequest["Test"] = "DT";
I could see the header in fiddler, but unable to see the same in "Tagged web request"
Any help is greatly appreciated.

In order to work this code should be in the OnBeforeRequest method. Is it there?
Also if there are other proxies between Fiddler and Dynatrace they ight remove the header. The chance for that happening increases if this is some standard HTTP header. Have in mind that if your system had a proxy set before running Fiddler then Fiddler will automatically use the original system proxy as an upstream proxy.

Related

fiddler modify response header

I'm working with an API that doesn't yet have CORS setup. So, instead of waiting until that's setup, I thought I could use fiddler to add the Access-Control-Allow-Origin header to the responses coming from the server. I haven't used fiddler for a while and can't figure out how to add headers to the response. Is this not supported in the free version of fiddler-everywhere?
It's not ideal, but I found a workaround. After the requests have gone off once, I right-click the ones I'm interested in and select "Add new rule". The rule will automatically do an exact match to the URL and sets the action of "Return manually crafted response" If I edit the rule, the header can be added in the raw text.

Talend tRestClient Consume REST API with 1 header

I'm trying to call a simple 'Hello World' REST API via the GET verb. The API is only expecting one HTTP Header, Accept application/json which i've set in the Advanced Settings>HTTP Headers of my tRestClient component. However, looking at the code tab, Talend seems to automatically create another entry for the contents of the Accept Type dropdown. When i run I’m getting HTTP 406 Not Acceptable back because the API is not expecting 2 headers.
I've tested this API with other software and it responds correctly so it must be down to Talend configuration. Anybody know a way around this or had a similar issue they've resolved?
I have screenshots but unfortunately they're being blocked by my firewall at work.
Thanks
tRESTClient defines its http headers based on the parameters you supply in the component settings. It has an "Accept Type" setting, which you can set to "JSON", this adds the http header "Accept: application/json" (this way you don't have to add it in the http headers section).
For your use case, you can also use tREST, which allows you to have complete control over http headers, it only sends those you set in the http headers section.

PHPStorm REST Client - Basic Authentication

I have written my own API which requires basic authentication, such as:
user:james
pass:1111
I can call resources using urls such as:
http://api.james.com/myapi/orders/get
I wish to be able to use the REST client in PHPStorm but I cannot work out how to send my authentication details. Does anyone know how to do this? Do you have to setup a Proxy server, or can you pass the authentication somehow in the URI above?
Any help would be appreciated.
Regards
James
For usage Basic Auth you will need send header 'Authorization', for example:
Authorization: Basic amFuc29uQG1haWwucnU6MTIzNDU2
Value of this header you can get from debug console of your browser (firebug in FireFox or developer tools in Chrome). Start GET request from your browser, when you will need authorize - do it. Than open debug console 'network' tab and try this request one more time.
Now you will find in headers new one 'Authorization', that formed by browser when you was authorized.
Just copy content of this header and use it in PhpStorm REST-client.

how to see httpS request & headers on win?

I'm working on developing some tests that will work with rest api.
I have restClient in Firefox and my eclipse where I run requests through HttpsURLConnection.
My problem is that sometimes when i send Exactly Same requests through restClient and java - i get different responses. I’ve been having that problem forever..
Usually I’d find the way around after sometime. It would be super helpful If I could see requests that were sent and compare it...
I don't have adminRights on my Pc, so i was looking into some portable apps. I also have wireShark but it wouldn't help.
try that tool, it is called burpsuite. You can install cert to your burpsuite and then once it is all set you will be able to read all requests.
http://portswigger.net/burp/
Hope that helps.
If you have the SSL private key, then you can decrypt the HTTPS packet using the Wireshark.
http://wiki.wireshark.org/SSL
If not, it is difficult.
You can see http headers of any website on any browser like this:
javascript:var req = new XMLHttpRequest();req.open('GET', document.location, false);req.send(null);var headers = req.getAllResponseHeaders().toLowerCase();alert(headers);
Paste above code to address bar of browser and hit enter.

How send application/x-www-form-urlencoded params to a RestServer with JMeter?

I developed a rest server, and I put it to run in localhost, and I'm trying to perform tests with JMeter, sending requests posts and gets (depends of called method).
I already send to Rest server and got result with JMeter in simple post requests, get requests, sending files with post, and sending a Json with post.
But I don't know how to send a Form-UrlEncoded object to server. My Rest server consumes application/x-www-form-urlencoded, and I need to send 3 String parameters.
There's some way to set the MimeType for every parameter and perform the test ?
I'm using Jmeter 2.7
[Update]
I solved this by disabling the option:
use multipart/form-data for post
And enabling:
redirect automatically
Instead of:
follow redirect
The parameters I put normally in the table "Send parameters with the Request" with each respective names.
For sending form parameters as application/x-www-form-urlencoded, add a header parameter Content-Type with value application/x-www-form-urlencoded.
The following steps is aplicable for Jmeter 2.3.4
Add a HTTP Header Manager under your http Request.
Add new parameter to HTTP Header Manager with name Content-Type and value application/x-www-form-urlencoded.
Uncheck "Use multipart/form-data for HTTP POST" of HTTP request.
Uncheck "Encode?" of each request parameter(not necessary).
kept "Content Encode:" text box of HTTP request as empty.
This won't work for PUT request.
For put request add parameters as path parameter and set Content-Type header then Jmeter will do by itself.
Here's the solution for HTTP POST with x-www-form-urlencoded testing with jmeter. You just folllow like these.
Go to Thread Group -> Add listener -> Views Result in table, View result Tree. To see the process of responding.
Have you tried to save your test using BadBoy or JMeter Proxy to see what your application actually sends?
To see what happens under the hood you can also use FireBug if you're using FireFox or Ctrl+Shift+i if you're on Chrome.
IllegalCharsetNameException will go immediately only after you will add the required content-type in HTTP Header Manager for HTTP request .
Hope this helps.
followed exact steps mentioned i still see an exception thrown
Response code: Non HTTP response code: java.nio.charset.IllegalCharsetNameException
Response message: Non HTTP response message: application/x-www-form-urlencoded
java.nio.charset.IllegalCharsetNameException: application/x-www-form-urlencoded
at java.nio.charset.Charset.checkName(Charset.java:315)
at java.nio.charset.Charset.lookup2(Charset.java:484)
at java.nio.charset.Charset.lookup(Charset.java:464)
at java.nio.charset.Charset.forName(Charset.java:528)
at org.apache.http.entity.ContentType.create(ContentType.java:210)
at org.apache.http.entity.StringEntity.<init>(StringEntity.java:116)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:1340)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.handleMethod(HTTPHC4Impl.java:592)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:409)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1166)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1155)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
at java.lang.Thread.run(Thread.java:745)