What is the best way to find an http response that has a certain string of text in its response? - ajax

I'm debugging a web app with lots of AJAX on a windows machine. I have Fiddler and Wireshark and I'm open to getting any other free software that can help.
I am looking for the http response (and its request) that contain a certain string in them. What is the best way to find it?

This task is utterly trivial in Fiddler. Cause the traffic to happen, then hit CTRL+F and type the string you're looking for.
If you want Fiddler to automatically mark any sessions that contain a given string, use the utilFindInResponse method.

I'd recommend using Firefox with the Firebug addon!

Related

Bad Encoding or Strange Characters in Jmeter HTTP Request POST Option

I have been trying to record session and I got some "bizarre" characters in the POST Option in the HTTP Request component. I need some MAGIC Advice with this(picture).
Stranges Characters Appear in the POST Option in the HTTP Request component
That's it, as you can see, Jmeter in the recorded session, put me Characters that I don't understand. I seen 1000000 videos and in all of those videos the tool always show the information with no problems.
I alreade try to put utf-8 in the "Content Encoding" also change the jmeter.properties file enabling the "sampleresult.default.encoding=utf-8" option, In FACT, I try to edit the proyect modifying the ApacheJMeter_http.jar file (I found in the file that still using encoding=ISO-8859-1). I dig in almost all sites looking for a solution and I found NOTHING that can help me to fix this and I have to buils a report for my jobs next week. Please any help will be appreciated.
my Best
PG
Switching to "Parameters" tab of the HTTP Request sampler will not work given you have something in the "Body Data" tab no matter which "encoding" is being used
I don't think your goal is to test https://ocsp.digicert.com/, my expectation is that you need to exclude this domain from your testing scope
Just in case you don't need to recompile or reverse engineer anything, the "encoding" of JMeter HTTP Request samplers can be controlled either using the relevant field:
or by manipulating the relevant JMeter Properties

Can Charles map incoming request using saved session?

In my team, QA will test the application, if there's a bug, QA will record a charles session and provide the file to developer.
Now as a developer, I want to quickly reproduce the bug. Currently what I do is manually save the response, then use the "map local" tool to create a "map local" relationship between the request and response.
But it's tedious and cumbersome if there're multiple requests I need to mock. I'm thinking is it possible just simply tell charles, "hey charles, Use the current recorded session as source, if any future request match one of the recorded request, just use the recorded response. if none request match, let it pass through".
Then when I get a charles session file, it'll be very easy for me the set up the mock response. I can start troubleshooting the bug in just seconds.
I'm not sure if this can help but basically, if QAs spot any bugs, they can use the "export flow" feature and then share with you these exported files. When you import such files, you would be able to reproduce quickly without setting up as the request/ response have already been saved.
However the tool I'm using is Proxyman instead of Charles. You can find the detail instruction at
https://proxyman.io/blog/2019/07/How-I-use-Proxyman-to-report-bugs-more-effectively.html. Hope it helps!

Resume in articulate with tin-can api

I am trying to implement this endpoint activities/state/?method=GET in my LRS - but I can not seem to get the resume functionality working. I have all the data, but not sure what does Articulate expect the LRS to return in order to resume where the user left off. I also tried looking at Articulate support page, but nothing useful so far. Any help would be appreciated.
It's looking for the state string to be returned. Which is just a long string that is sent out when the state ( bookmark ) is saved.
I recommend testing with the Golf Prototype at http://tincanapi.com/prototypes/ first so that you know the issue is with the LRS. Try the prototypes in both Internet Explorer and another browser such as Chrome; any difference in behaviour could be a clue.
Please also look at your network tab in Chrome's developer tools and let us know if any requests are failing and what is being stored and retrieved from the State.
Full details of how the State API is supposed to work are found in the spec. Here's the relevant section in version 1.0.2: https://github.com/adlnet/xAPI-Spec/blob/a752217060b83a2e15dfab69f8c257cd86a888e6/xAPI.md#stateapi
It's also worth noting that building an LRS is hard. There are a number of commercial and open source LRS that will likely be cheaper than building one yourself.
I managed to get this working. I was using .NET Web API.
I had to explicitly set the content-type header to octet-stream - It was defaulting to text/html.
The following code did the trick:
HttpResponseMessage httpResponseMessage = Request.CreateResponse(HttpStatusCode.OK);
httpResponseMessage.Content = new StringContent(studentModuleName.SuspendData);
httpResponseMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");

Is there a way to see the final URL retrieved by an XMLHttpRequest?

I'm doing an AJAX download that is being redirected. I'd like to know the final target URL the request was redirected to. I'm using jQuery, but also have access to the underlying XMLHttpRequest. Does anyone know a way to get the final URL?
It seems like I'll need to have the final target insert its URL into a known location in the headers or response body, then have the script look for it there. I was hoping to have something that would work regardless of the target though.
Additional note: I'm asking how my code can get the full url from production code, which will run from the user's system. I'm not asking how I can get the full url when I'm debugging.
The easiest way to do this is to use Fiddler or Wireshark to examine the HTTP traffic. Use Fiddler at the client if your interface uses a browser, otherwise use Wireshark to capture the traffic on the wire.
One word - Firebug, it is a Firefox plugin. Never do any kind of AJAX development without it.
Activate Firebug and select Net, then perform your AJAX request. This will show the URL that is called, the entire request (header and body) and the entire response (once again, header and body). It also allows you to step through your JavaScript and debug it - breakpoints, watches, etc.
I'll second the Firebug suggestion. You'll see the url as the "Location" header in the http response.
It sounds like you also want to get this url in js? If so, you can get it off the xhr response object in the callback (which you can also inspect using FB!). :)

Where is Firefox's URL processor?

After 3 days digging in this Mozilla NSS and the Firefox source codes (and some extensions and running the SSLsample codes too), I'm clearly lost now.
My intention is just to do simple thing. To divert any https request from Firefox to my very own callback functions. In which, my callbacks here have some information for the NSS/SSL to work with.
My only problem is, where is Firefox's code for processing the https URL. I mean, when we key in the https address at the address bar, we press Enter. I just need access to the source that triggers at that point (after we press Enter). Somehow, I can intercept any request for https URLs.
Thanks.
So, you want to intercept the data, right? You'll want to play around with this interface.
not sure, if it helps, but I asked this question:
XULRunner: Prevent links to arbitrary domains
Maybe it could be sufficient for your task to use the method explained in the first answer. However, it is an all-JavaScript solution.
Cheers,

Resources