Can I use Firebug to inspect a post request sent by a webpage to a server and if so how?
I am refering inspecting a regular POST made using a form, but would also be interested in knowing how to inspect posts using javascript.
Thanks
Of course you can do that. The Net panel allows you to expand every request related to a website. For a POST done via AJAX you can set the XHR filter to see only those requests.
If you expand a request by clicking on it, you'll get all the information related to it.
Sebastian
Related
I need to post result with Ajax, but the API I'm posting to uses 302 redirect to display results. Ajax won't follow the redirect, so I can never get my data. I just get a null response.
I can do a casper.open() and then it will at least post and follow to get results, but I don't want to navigate off page to get this result.
Any suggestions?
According to the question Why browser do not follow redirects using XMLHTTPRequest and CORS? this may be related to the problem with a cross-domain request and preflight checks.
The solution would be to run CasperJS with the --web-security=false option which PhantomJS provides:
casperjs --web-security=false script.js
Another possibility is to open a new tab/window. A casper instance manages only one main page (and multiple popups or child windows). If you're not in the test environment of CasperJS, then you can create a second casper instance and navigate to the other page. My answer here provides a drop-in solution for this with a usage example.
According to this website: I am trying to make a request, send data, and hope to get the result like json format, but not have to be.
In the sandbox page, I've checked the javascript, (I am using Chrome browser, you can go to "resources" -> Frame folder -> sandbox.ala.org.au), it uses AJAX to send and get data.
For example, there is a function (parseColumns), which is using ajax for sending data and getting result.
Is there any other way instead of ajax that could make a request to the server and get the result data? Because I am trying to create an application work similar with the sandbox.
One alternative is to make regular http requests. The problem with this approach is that you have to decipher the data format for input and output.
You can see all the request/response traffic in details, from and to your browser, using firebug (https://getfirebug.com/) and enabling the "net" tab
when you mouse over the "POST" line in the URL column, it shows you the complete URL. Click on the (+) to expand the request item to see details on the request.
As we know, GET method sends data via URL. We can use both GET and POST method in ajax. My question is, why can't we see the data in URL when we use ajax with a GET method?
AJAX call is not visible through url.
Try to use firebug extension of firefox.
In firebug, you will find all request in console.
When you fire off your ajax request like this:
The Chrome network tab will show new line for this transaction:
If you click on it, it will show you all the details:
If you'd like more information on constructing your own querystrings, look at this other question: How to build query string with Javascript
I have been trying to scrape information from a site where the relevant information is continuously updated using Ajax calls . Inspite of repeated attempts, I haven't been able to determine the link from which the ajax calls are receiving data . So , I decided to change track and use firebug to get the data since it is showing me the data got from the Ajax call. So, does Firebug save the page source anywhere and can we access that by any chance?
This is the link and I am trying to get the song + movie name from the bottom of the page which is updated using Ajax calls. I have tried going through the firebug source code to determine the save but that has also not yielded any result.
Actually I did find the solution to my problem . Looking under Net tab in firebug, I was able to find out the ajax call that was editing the particular site. Using the response I finally managed to use urllib and urllib2 to get the required data :).
As for how firebug gets the source code , there were a few links that I read which said that Firebug gets the exact source code at that instant because it is a browser extension and so has more access to the browser variables and the server response. But not sure how correct the information is.
Cheers
I would like to set Firebug to automatically display results of a POST or GET ajax request.
Is there such an option to automatically open the response tab? When I am debugging multiple requests it is a bit tedious to click on each one. I've looked through the general options and also done some Google searching.
http://img109.imageshack.us/img109/3279/firebug.jpg
The simple solution for me was to just start using FireLogger instead. Simpler and cleaner.
Cya later FirePHP!!
image http://img809.imageshack.us/img809/7227/firelogger4phpmainshot.png