HttpWebRequest problem: Please help

S

Sojwal

We are working on a asp.net application in which we need to send some
data to a PHP application on another server. We are using
HttpWebRequest object to 'POST' the data to a PHP page as key-value
pairs, which will be accessed by the PHP script as posted variables.
The requirement is to name all keys in the posted data as the same
name, which ideally should result in getting an array of the data on
the PHP side. For example, if data is sent as key=abc&key=def&key=123"
then the PHP page should get an array containing members "abc", "def"
& "123". This is not happening..what we get on PHP side is a single
comma
separated string like "abc,def,123". The code for posting form data
using HttpWebRequest is standard as shown on many sites. What are we
doing wrong here?
Thanks in advance.
 
F

Feroze [msft]

If all you want to do is a form POST, why dont you use WebClient?

WebClient has a method called UploadValues which will format the upload
correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top