Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Post data with webNavigation.loadURI

Reply
Thread Tools

Post data with webNavigation.loadURI

 
 
Björn Langhof
Guest
Posts: n/a
 
      10-31-2006
Hallo.

I'd like to post data from a Firefox extension.

The HTML-Formular I want to fake looks like this

<form action="http://homepage/phpinfo.php" method="post">
<input name="name" value="foo">
<input name="id" value="bar">
</form>


The code I use is this:

var body = '\r\nname=foo&id=bar\r\n';
var webNav =
_content.QueryInterface(Components.interfaces.nsII nterfaceRequestor).
getInterface(Components.interfaces.nsIWebNavigatio n);

var sis = Components.classes["@mozilla.org/io/string-input-stream;1"].
createInstance(Components.interfaces.nsIStringInpu tStream);

sis.setData(body, body.length);

document.getElementById("content").webNavigation.l oadURI('http://homepage/phpinfo.php',
0, null, sis, null);


The requested page is opened and displayed. But there is no post data at
all.

Now I've installed the Firefox-Extension tamper to monitor the HTTP-Header.
For the HTML-Formular the table of the post-parameter looks like this:
Name: Value:
name foo
id bar

For my loadURI-request:
Name: Value:
POST_DATA name=foo&id=bar

So there seems to be something wrong. But I can't figure out what's
wrong and how to fix it. Do you have any suggestions?

Thanks for your help.

Greetings,
Björn
 
Reply With Quote
 
 
 
 
Björn Langhof
Guest
Posts: n/a
 
      11-03-2006
Björn Langhof schrieb:
> I'd like to post data from a Firefox extension.


[...]

> So there seems to be something wrong. But I can't figure out what's
> wrong and how to fix it. Do you have any suggestions?


Does nobody know the answer or is this the wrong newsgroup for this
question? Unfortunately in mozilla.dev.extensions there is also no reply.

Hoping desperately for help. Greetings,
BJörn
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading URLs with POST data vs. w/out POST Hal Vaughan Java 4 01-14-2008 12:38 AM
How does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
Post data via the Post method in asp.net? (URGENT) Vishal ASP .Net 1 12-21-2004 06:14 AM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM
post data, then post again.. JT ASP General 1 09-05-2003 11:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57