How can I setup Fiddler to make multiple requests at once? - fiddler

I have the following requests in my fiddler scratchpad and would like to know how I can send all of them at once?
I just do a spot check of our servers during fire fights to see response code and response times.
GET http://xx.xx.xxx.123/api/1/getit?what=this HTTP/1.1
Host: xx.xx.xxx.123
User-Agent: Fiddler
accept: text/xml
GET http://xx.xx.xxx.321/api/1/getit?what=this HTTP/1.1
Host: xx.xx.xxx.321
User-Agent: Fiddler
accept: text/xml
o o o
What I really hoped would be feature in scratch pad in fiddler is to highlight multiple requests and it would send them out simultaneously.

Instead of using the scratchpad, save a SAZ file containing the desired requests. When you want to play them back, load the SAZ file, Select All, and hit either the R or V keys.
(Learn more about the new Verify feature here: http://www.telerik.com/automated-testing-tools/blog/eric-lawrence/13-02-08/announcing-fiddler-2-4-3-beta.aspx)

Related

Postman file upload boundary

I'm trying to upload a file with my REST POST request. It is not working out. When i try to look at the request postman give:
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 44262
Content-Type: multipart/form-data; boundary=--------------------------085877645320272030820682
Host: localhost
Why there is a boundry? why postman doesn't return the file that i uploaded?
Adding an attachment as 'binary' would solve the POST request problem in your case.
If you would like to download the same attachment, there should be an GET request towards the API.
If that doesn't solve, you should describe your issue better with some pictures to understand better.

Different Responses from Insomnia and Postman for a WebRequest

I am using Postman Tool and Insomnia(Hurl.eu) Tool to make a Particular webRequest.
I get the Response 200 from Insomnia but i am getting 403 Forbidden error from Postman.Here are the Preview messages from both
Postman:
POST /ccadmin/v1/login HTTP/1.1
Host: ccadmin-test-XXXX.oracleoutsourcing.com:443
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.NlCxWPgJAizSO60YeIBQRjgrYlgUhywr8vmnIca69A=ehkZS1iMzUyLWZkNmE1ODM1ZDM3NSIsImlzcyI6ImFwcGxpY2F0aW9uQXV0aCIsImlyJleHAiOjE1MDU4MzQ5NjIsInN1YiI6ImRiZTYwMGFkLWQwNjYtNDhdCI6MTQ3NDI5ODk2Mn0=.
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
Insomnia(Hurl):
POST /ccadmin/v1/login HTTP/1.1
Host: ccadmin-test-XXXX.oracleoutsourcing.com:443
Accept: */*
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.NlCxWPgJAizSO60YeIBQRjgrYlgUhywr8vmnIca69A=ehkZS1iMzUyLWZkNmE1ODM1ZDM3NSIsImlzcyI6ImFwcGxpY2F0aW9uQXV0aCIsImlyJleHAiOjE1MDU4MzQ5NjIsInN1YiI6ImRiZTYwMGFkLWQwNjYtNDhdCI6MTQ3NDI5ODk2Mn0=.
Content-Length: 29
Both request looks similar ,but i am getting 2 different responses.
I also disabled Postman Settings->
i)Send Postman Token Header
ii)Send no-Cache Header
I hope this will help you.
I have found that sometimes Postman behaves a bit weird when you are using Bearer Authorization, this since they made an update to the app and added the "Authorization" tab.
This has happened to me more than ones, specially on pre existing collection.
Let's give it a shot.
Delete the Authentication key on your header, I can see you wrote that one manually. And lets Postman handle that.
Open the Authorization tab, select the Bearer token type from the dropdown, add your token on the window in the left side.
Click on Preview Request.
Now you should be able to see the token on the headers "greyed out"
Open the console, this will help you checking the request and maybe you will find an adicional error.
On the console you can check the raw request and response, it helps.
Also you should try making a request from your machine using CURL ‘yes you can usit on windows and mac’, this way you can discard that you have a closed port.
Good luck

Reading http input request from the browser to a socket - never closes the input stream

I'm reading from the socket's input stream and never receives the end of stream signal. I'm reading an HTTP request made by a browser. See example below.
How do I know that there's nothing more to be read?
POST /hello?a=b HTTP/1.1
Host: 127.0.0.1:4444
Connection: keep-alive
Content-Length: 0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
Origin: null
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,he;q=0.6
The request is using HTTP 1.1, and has a (redundant in 1.1) Connection: keep-alive header. If the response does not contain a Connection: close header, the server will not close the connection after sending the response. This is how HTTP keep-alive is designed to work (see RFC 2616 Section 8 "Connections"). The client must look at the response headers to determine how to read the response body and determine when the response has ended (see RFC 2616 Section 4.4 "Message Length"), and then decide whether to close the connection or not. Do not rely on an end-of-stream signal, that is not how HTTP works.
Update: I just realized that you are writing the server, not the client. RFC 2616 Section 4.4 applies to reading requests as well. The client will send headers first, which are terminated by a "\r\n\r\n" sequence, and then the headers describe how the request body is formatted and terminated, which allows the server to read the body until the end of the request is reached.
The only "end-of-stream" indicator TCP can deliver is closing the connection.
If the connection remains open there is no possiblilty for TCP to tell you "That's it!", as TCP is stream oriented not message oriented.
So, whether there is more to read or not can only be decided on application (protocol) level.
In this case the application protocol is http. If you received the header by having received \r\n\r\n (as it looks like), it might tell you how much data there is to be expected via this line:
Content-Length: 0
It in fact here it tells you there is 0 bytes to come for this request.

How do I convert a REST HttpRequest captured via a web proxy tool into a link a user can click?

I have used a proxy tool to capture a certain REST HttpRequest. The request is a HTTP PUT command followed by an extremely long REST link containing specific data that gets sent to the server.
In the proxy tool it looks something like this:
Header
PUT http://XXX.XXX.XXX.XXX:8080/rest/blah/blah/.../ HTTP/1.1
Host: XXX.XXX.XXX.XXX:8080
User-Agent: Mozilla/5.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-language: en-us, en:q=0.5
Proxy Connection:keep-alive
Content-Type:XMLHttpRequest
Referer: http://XXX.XXX.XXX.XXX:8080/plugins/blah/blah
Content-length: 11156
Cookie: JSESSIONID=<really long alpha numeric>
Body:
{"links":{"self":"/rest/plugins/1.0/blah/blah.....
...
... lots and lots of JSON text
}
}
So the proxy tool has been helpful in identifying what the request looks like.
But the only way to generate this request is by clicking a button on the webpage. I would like to send exact same request on my own (like creating a custom link that when clicked generates a similar request to the one shown above). How do I do this?
Also, anything I type in the web browser URL area automatically is a "GET". How do I force a PUT?
Cookie: JSESSIONID=
This clearly indicates that the API you want to use is not a REST API, because it violates the stateless constraint of REST.
How do I force a PUT?
Probably you don't have a way to do that. It depends on the security settings of the web API. If you want to do this with AJAX from the browser, and your domain is different from the APIs domain, then you need a CORS header from the API, which allows your domain to read cross origin responses. By PUT the browsers sends a preflight first, and if it cannot read the response, it will never send the real PUT. Security policy and other headers can block XSS in the browser, so you probably don't have a way to do this from browser.
You can do this from your server by copying the request details and catching the session id somehow.
If the API allows access to 3rd party clients, then I suggest you to contact with them. If not, then you 99% that you won't be able to do this.

ASIHTTPRequest Removing Header information

Sorry in advance for the newbie question.
I am using ASIHTTPRequest to send and receive packets.
However, when I send a packet from the client to the server, the packet has a header attached to it:
POST / HTTP/1.1
Host: 192.168.0.6:8080
Accept-Encoding: gzip
Content-Length: 64
User-Agent: ASIHTTPRequestTests 1.0 (iPod touch; iPhone OS 4.1; ko_KR)
Connection: close
PACKET_TESTM0001
The only information I want my client to send is: PACKET_TESTM0001
Is there a way to remove all the above header (All lines including POST to User-Agent)
Thanks in advance for your helpful response.
That header is required by the HTTP protocol, so better you don't remove it or your web server will not accept the request.
If you do no want to use the HTTP protocol (i.e., you do not want to talk to a web server), then you can use NSStreams with sockets.
There's some confusion here between "packet" and "HTTP request". Googling those two terms would probably be enlightening for you.
ASIHTTPRequest makes, as the name implies, HTTP requests. It wants to be talking to an HTTP server, and then probably to some sort of server-side code to process the request.
Have you rolled your own server, here? Because you're not doing what is expected when you're talking HTTP.