Can't see HTTP POST parameters in firebug
I have page,default.a开发者_Python百科spx
, with a button. On Click of it, I sent a "HTTP POST" request with query string parameters to some server which returned me jSON data and also redirected me back to default.aspx
Now I wish to see what the request looked like and what all query string parameters was sent. However, in firebug(params) section, I can't see it. How do I view it ?
Isnt it as simple as enabling Persist on the Net panel in Firebug and see the details of each entry?
http://getfirebug.com/wiki/index.php/Net_Panel#Persist
When this option is enabled, the entries of the requests list are not deleted when reloading the page. Instead the are grouped by page request, which means, when reloading the page several times you will get several request trees having the page title as root.
If you are sending query parameters, it's a GET request. You should not mix the POST and the GET method, or you will run into trouble.
this code will log post or get data to your firebug window if found, place it in the page you request with ajax
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Specialized;
namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
NameValueCollection n = Request.QueryString;
int x = 0;
Response.Write("<script>");
foreach (string s in n)
{
// 3
// Get first key and value
string k = n.GetKey(x);
string v = n.Get(x);
// 4
// Test different keys
Response.Write("console.log('[" + k + "] => ");
Response.Write(v + "');");
x++;
}
if (x == 0)
{
Response.Write("console.log('QueryString is empty!')");
}
Response.Write("</script>");
}
}
}
精彩评论