473,394 Members | 1,878 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Post data with webNavigation.loadURI

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
Oct 31 '06 #1
1 2697
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
Nov 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Erik Johnson | last post by:
I am trying to work with a program that is trying make an HTTP POST of text data without any named form parameter. (I don't know - is that a normal thing to do?) I need to write a CGI program that...
15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
2
by: Keith Selbee | last post by:
I am trying to submit data to a webpage in the form of a post and my code is below. It is a function that takes a url and the post content as strings and then performs the post. But as soon as I...
2
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser ...
1
by: Manuel | last post by:
I have to log into a website and retrieve some information. The problem is that the post isn't "normal". I'm used to passing post values in the form of: Variable1=Value1&Variable2=Value2 etc. I...
2
by: Ben | last post by:
Hi I have the two funcions below, login_web that posts data to a webpage and fcn_parseviewstate that parses the viewstate data for the post. I have a problem with the strPostData, I have been...
10
by: Peter Michaux | last post by:
Hi, All Ajax libraries I've read use encodeURIComponent() on the name- value pairs extracted from forms before POST ing the result to the server with and xmlhttprequest. I can understand why...
5
by: manheim | last post by:
I have a page posting a raw jpg to me via HTTP POST. All reference I've found is centered around retrieving POST data as name/value pairs which will not work in this situation. What I need to do...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.