13

How can you see what the attribute rel contains when it is transferred by POST?

I transfer a variable by the rel attribute by jQuery. I would like to know what the attribute, $_POST['answer'], contains.

This question is based on: To make an action based on the link location by jQuery

jQuery IRC tells me that the solution seems to be Firebug somehow. How can you see POST data in Firebug?

Community
  • 1
  • 1
Léo Léopold Hertz 준영
  • 119,377
  • 159
  • 417
  • 655

2 Answers2

24

You can use the Network tab and look at the params tab as shown below (this was a get request to google where I search for the word hello).

alt text
(source: gyazo.com)

Glorfindel
  • 19,729
  • 13
  • 67
  • 91
redsquare
  • 75,782
  • 18
  • 147
  • 156
  • Safari's Web Inspector has something similar, but for some reason does nos show the parameters for a POST Ajax call -- http://stackoverflow.com/questions/1337897/how-to-debug-xhr-post-requests-in-safari-4 – Arjan Aug 29 '09 at 08:29
  • Just an FYI.... If you don't have an parameters passed, the "params" panel is missing. I thought I had a different version of Firebug or something b/c I didn't see it but it turned out that the reason my code isn't working is b/c I'm just not passing anything... lol... – gloomy.penguin Feb 14 '13 at 16:28
  • Link down? Btw. setting alt text to "alt text" doesn't help much. – David Mašek Mar 05 '16 at 21:24
  • @DavidMašek what can I say, it was 6 yrs ago...! – redsquare Apr 21 '16 at 21:39
  • @redsquare Fair point. I didn't notice and found the 'alt text' alt text kinda funny. But your answer is still usefull after 6 years, so good work and thanks. – David Mašek Apr 22 '16 at 16:28
2

There are various tools you can use to capture such information. I use a plugin for Firefox called Live HTTP Headers, which lets you view the HTTP headers that are being transferred in each request, so you would be able to view your post variable.

Firebug can also be used, it is also a plugin available for Firefox. Select the Net tab, then select All. Here you will see a list of all requests. Now you can expand each request to view the headers (and hence the post variables).

DaveJohnston
  • 9,755
  • 10
  • 51
  • 81
  • 2
    My answer was posted before the line 'How can you see POST data in Firebug?' was added to the original question, don't really think it deserves to be down voted. – DaveJohnston Aug 29 '09 at 07:57
  • +1 for Live HTTP Headers, because it also allows for re-sending the same request after changing some of the data. (I don't see an earlier revision of this question without that line about how to use Firebug though. Still, I think the introduction of the question is long enough to assume the questioner is open to alternatives.) – Arjan Aug 29 '09 at 08:34
  • I don't see an earlier revision either, but unless I am going mad that line was not there when I first looked at the question. Given that it is in bold too I don't see how I could have missed it. – DaveJohnston Aug 29 '09 at 09:06
  • 1
    (If it makes you sleep better to know you're not going mad: question was asked at 07:43, your answer was posted 07:49. I guess the change was made in the 5 minute window during which one can edit posts without creating a new revision, while you were typing your answer then.) – Arjan Aug 31 '09 at 19:29