Zdravim.
Mam takovy problem viz obr -> http://koukej.707.cz/…HTTPSend.png
Pouzivam tento kod na odesilani
string HttpPost(string uri, string parameters)
{
System.Net.ServicePointManager.Expect100Continue = false;
WebRequest webRequest = WebRequest.Create(uri);
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.Method = "POST";
byte[] bytes = Encoding.ASCII.GetBytes(parameters);
Stream os = null;
try
{ // send the Post
webRequest.ContentLength = bytes.Length; //Count bytes to send
os = webRequest.GetRequestStream();
os.Write(bytes, 0, bytes.Length); //Send it
}
catch (WebException ex)
{
MessageBox.Show(ex.Message, "HttpPost: Request error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (os != null)
{
os.Close();
}
}
try
{ // get the response
WebResponse webResponse = webRequest.GetResponse();
if (webResponse == null)
{ return null; }
StreamReader sr = new StreamReader(webResponse.GetResponseStream());
return sr.ReadToEnd().Trim();
}
catch (WebException ex)
{
MessageBox.Show(ex.Message, "HttpPost: Response error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return null;
}
Na internetu jsem nasel ze by to mel resit tento kod co mam na zacatku
System.Net.ServicePointManager.Expect100Continue = false;
Funguje mi to ale jenom kdyz posilam pozadavek na Pridani do Databaze ale jakmile poslu pozadavek na Editaci prispevku tak mi to vyhodi tento error.
Pokud bude potreba doplnit php script (MySql Query popřípadě co posilam za parametry tak staci napsat)