Click here to Skip to main content
15,888,177 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dataview Pin
Heath Stewart29-Apr-04 3:07
protectorHeath Stewart29-Apr-04 3:07 
Generalminimization effect Pin
ecolner28-Apr-04 0:07
ecolner28-Apr-04 0:07 
GeneralRe: minimization effect Pin
Mike Dimmick28-Apr-04 2:29
Mike Dimmick28-Apr-04 2:29 
GeneralLogging/Debug Output/Verbose Mode Pin
MrEyes27-Apr-04 23:20
MrEyes27-Apr-04 23:20 
GeneralRe: Logging/Debug Output/Verbose Mode Pin
Dave Kreskowiak28-Apr-04 1:48
mveDave Kreskowiak28-Apr-04 1:48 
GeneralRe: Logging/Debug Output/Verbose Mode Pin
Heath Stewart28-Apr-04 3:28
protectorHeath Stewart28-Apr-04 3:28 
GeneralRe: Logging/Debug Output/Verbose Mode Pin
Heath Stewart28-Apr-04 3:34
protectorHeath Stewart28-Apr-04 3:34 
QuestionHow to send request to php page using POST method Pin
Alex Getman27-Apr-04 22:58
Alex Getman27-Apr-04 22:58 
Hi Gurus! Please help me with little problem I got..
I do following thing to send data to php page through POST method:

HttpWebRequest myHttpWebRequest = (HttpWebRequest )WebRequest.Create(@"http://www.umc.ua/misc/sendsms.php");

string postData="?network1=UMC&Phone1=5918658&Message=HellofromCSharp&sender_name=sn";
ASCIIEncoding encoding=new ASCIIEncoding();
byte[] byte1=encoding.GetBytes(postData);
// Set the content type of the data being posted.
myHttpWebRequest.ContentType="application/x-www-form-urlencoded";
// Set the content length of the string being posted.
myHttpWebRequest.ContentLength=postData.Length;
Stream newStream=myHttpWebRequest.GetRequestStream();

newStream.Write(byte1,0,byte1.Length);

RES_text.Text = "The value of 'ContentLength' property after sending the data is {0}" + myHttpWebRequest.ContentLength.ToString();
// Close the Stream object.
newStream.Close();

BUT when I click send buton which invokes this code, following exception occurs:


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Net.ProtocolViolationException: Cannot send a content-body with this verb-type.
at System.Net.HttpWebRequest.BeginGetRequestStream(AsyncCallback callback, Object state)
at System.Net.HttpWebRequest.GetRequestStream()
at sm.Form1.heath_Click(Object sender, EventArgs e) in c:\test projects\sm\form1.cs:line 281
at System.Windows.Forms.Control.onclick(EventArgs e)
at System.Windows.Forms.Button.onclick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
sm
Assembly Version: 1.0.1578.33862
Win32 Version: 1.0.1578.33862
CodeBase: file:///C:/Test%20Projects/sm/bin/Debug/sm.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:





When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.



www.xedom.com
AnswerRe: How to send request to php page using POST method Pin
Heath Stewart28-Apr-04 3:26
protectorHeath Stewart28-Apr-04 3:26 
GeneralRe: How to send request to php page using POST method Pin
Alex Getman28-Apr-04 5:04
Alex Getman28-Apr-04 5:04 
GeneralRe: How to send request to php page using POST method Pin
Heath Stewart28-Apr-04 10:23
protectorHeath Stewart28-Apr-04 10:23 
GeneralRe: How to send request to php page using POST method Pin
Alex Getman28-Apr-04 20:25
Alex Getman28-Apr-04 20:25 
GeneralRe: How to send request to php page using POST method Pin
Heath Stewart29-Apr-04 3:06
protectorHeath Stewart29-Apr-04 3:06 
GeneralOut of Process Server in C# Pin
Colin Herkes27-Apr-04 21:05
Colin Herkes27-Apr-04 21:05 
GeneralRe: Out of Process Server in C# Pin
Heath Stewart28-Apr-04 3:17
protectorHeath Stewart28-Apr-04 3:17 
GeneralRe: Out of Process Server in C# Pin
Colin Herkes29-Apr-04 21:24
Colin Herkes29-Apr-04 21:24 
GeneralRe: Out of Process Server in C# Pin
Heath Stewart30-Apr-04 2:57
protectorHeath Stewart30-Apr-04 2:57 
GeneralRe: Out of Process Server in C# Pin
Colin Herkes3-May-04 0:19
Colin Herkes3-May-04 0:19 
GeneralRe: Out of Process Server in C# Pin
Heath Stewart3-May-04 1:49
protectorHeath Stewart3-May-04 1:49 
GeneralRe: Out of Process Server in C# Pin
Colin Herkes3-May-04 2:54
Colin Herkes3-May-04 2:54 
GeneralRe: Out of Process Server in C# Pin
Heath Stewart3-May-04 3:18
protectorHeath Stewart3-May-04 3:18 
GeneralRe: Out of Process Server in C# Pin
leppie28-Apr-04 8:39
leppie28-Apr-04 8:39 
GeneralRe: Out of Process Server in C# Pin
Colin Herkes29-Apr-04 21:26
Colin Herkes29-Apr-04 21:26 
GeneralRe: Out of Process Server in C# Pin
leppie30-Apr-04 6:55
leppie30-Apr-04 6:55 
GeneralDirect X Pin
mookeroo27-Apr-04 15:37
mookeroo27-Apr-04 15:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.