Looking to add more .dat auto responses to Fiddler i.e. 500, 504, etc - fiddler

I am trying to add more basic server response code error messages to to Fiddler auto responder. In the dropdown there are currently a bunch of .dat files with responses such as 404, 502, etc. I would like to add more of these http codes but kind find how to do it. Is there a way to get more of these options in the auto responder?

You can add these in %LOCALAPPDATA%\Programs\Fiddler\ResponseTemplates. The format could be copied from the existing ones, basically:
HTTP/1.1 <CODE> <MESSAGE>
<HEADER1>: <VALUE1>
<HEADER2>: <VALUE2>
...
Then restart Fiddler and the new response will be added in the UI.

Related

How to change data source of report in jasper server using rest service

I am new to Jasper Server. I have successfully created a simple report and pushed it to server and I am able to run it through rest service using postman. Now my next requirement is to change data source of report so that we can have advantage of using same report with different data. I have searched but could not find a working answer. I am using jasper server 8.0.I would appreciate a solution that would work with postman
First we need to get the descriptor of file whose data source we want to change.
Descriptor basically describes our file in server.
Make a “GET” call to the link
http://:/jasperserver/rest_v2/resources/reports/
path/to/report
and set headers to
Content-Type: application/repository.file+json
Accept: application/json
Copy the returned json (descriptor)
Now make a “PUT” call to the link
http://:/jasperserver/rest_v2/resources/reports/
path/to/report
and set headers to (very important)
Content-Type: application/repository.reportUnit+json
Accept: application/json
And inside body paste the descriptor you copied and change the things you want.
and send it.

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.

How to show streams inline as HTTP chunked response with play framework

Am following the "Streaming HTTP Response" documentation of Play2! framework which describes how a file or stream could be sent as chunked responses. The http-action code I wrote after reading this is very simple -
Ok.chunked(
Enumerator.fromStream(istream).andThen(Enumerator.eof)
)
With this code everytime I refresh the URL the data in the stream gets downloaded as a file by the browser. Instead of downloading as a file I want the stream content to shown inline in the browser as text. The File example on the documentation page describes how one could do this with files... but looking at the APIs I dont see an inline option with streams. So is it possible to show stream data inline with chunked responses everytime I refresh the browser? If my expectation is invalid then a little explanation of why-so will be very welcome.
From my comment: You should set a content-type supported by your browser (like text/plain or text/xml) when sending the response, otherwise you're just sending bytes and the browser doesn't "know" it can display it.
Update: adding the exact code that solved the issue:
Ok.chunked( Enumerator.fromStream(istream).andThen(Enumerator.eof) ).as("text/html")

Fiddler not picking up Content-Type

I'm trying to test some calls but the content-type is text no matter what I do. I try to specify as json or xml but it doesn't matter and not sure why:
I suspect you're getting confused about the Content-Type column, which shows the Content-Type of the response, not the request.
Double-click the Web Session to inspect the request and response using the Inspectors. The Request is shown in the top set of tabs while the Response is shown in the bottom set.

Fiddler2 - How do I URlDecode the Request body for Viewing?

I'm using Fiddler to debug some particularly painful AJAX code, and in the POST requests that are being sent across to the server the Request BODY is UrlEncoded. This leads to me having to cut and paste the text into an online app to UrlDecode the text into the JSON object for the request. There has to be a better way to do this.
Does anyone know how I can make fiddler automatically URLDecode the body of the POST Request?
Well, you can simply press CTRL+E to decode locally. But depending on the format, you may also be able to use the WebForms Inspector.
Fiddler can manipulate the HTTP request and response in any way you like:
https://stackoverflow.com/a/23615119/264181