473,388 Members | 1,277 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,388 software developers and data experts.

HttpWebRequest problem: Please help

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.
Nov 18 '05 #1
3 1020
Hi Sojwal:

A tool you can use is Fiddler:
http://www.fiddlertool.com/fiddler/

What I'd do is capture the web request your application makes and
capture a web request made by a browser (or something that is sending
the correct reauest to the PHP app). Then you can compare the payload
of the two requests to see what you might be missing.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 3 Nov 2004 07:35:18 -0800, so************@hotmail.com (Sojwal)
wrote:
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.


Nov 18 '05 #2
Sojwal wrote:
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?


Show your code anyway ;-)

Cheers,

--
Joerg Jooss
www.joergjooss.de
ne**@joergjooss.de
Nov 18 '05 #3
"Joerg Jooss" <jo*********@gmx.net> wrote in message news:<#9**************@TK2MSFTNGP11.phx.gbl>...
Sojwal wrote:
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?


Show your code anyway ;-)

Cheers,


The problem was solved by posting the data as
"key[]=abc&key[]=def&key[]=123" as required by PHP. But thanks for
replying to my post.
Nov 18 '05 #4

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

Similar topics

10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
3
by: ME | last post by:
Hi; I am getting "Unhandled Exception: System.Net.WebException: The remote server returned an erro r: (401) Unauthorized." when I am trying to get a page via post. Code follows...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
5
by: japslam japslam via DotNetMonster.com | last post by:
Hi all, I have problem when I use HttpWebRequest and take long time to call to my service server. If at that time there are many request comes in semultaneous, I will get this exception ...
7
by: gorkos | last post by:
Hi, I am two days trying to solve a problem with some pages, which i get through HTTPWebRequest. Error is that some pages need Script to be enabled. But how to do this in HTTPWebRequest class?
0
by: boxboy | last post by:
Hi, I'm writing a console application and am having a problem with HttpWebRequest when posting data to a webserver. A "System.Net.WebException: The server committed a protocol violation" is always...
3
by: JansenH | last post by:
We have implemented a 'HTTP Post' client in C# that posts Xml documents to a webserver. This is working fine if the post rate is one post for every 20 seconds. But if the post rate is increased to...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
7
by: Marc Bartsch | last post by:
Hi, I have a background worker in my C# app that makes a synchronous HttpWebRequest.GetResponse() call. The idea is to POST a file to a server on the internet. When I call HttpWebRequest.Abort()...
2
by: =?Utf-8?B?TGFycnlLdXBlcm1hbg==?= | last post by:
Our WebDev team seems to have found a problem that exposes a bug in .NET 2.0. This problem can be shown when trying to access a WebService using SSL and through a proxy server after using the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.