Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The first thing I see wrong is that you're trying to use a query string to post the form data. Your "form data" should be like so:</p> <pre><code> String ali = "datafromuser=&lt;CC5Request&gt;&lt;Name&gt;Mert&lt;/Name&gt;&lt;Password&gt;123&lt;/Password&gt;&lt;ClientId&gt;xxxx&lt;/ClientId&gt;&lt;IPAddress&gt;213&lt;/IPAddress&gt;&lt;Adress&gt;asdsa&lt;/Adress&gt;" + "&lt;OrderId&gt;123&lt;/OrderId&gt;&lt;Type&gt;Auth&lt;/Type&gt;&lt;Number&gt;1234567891234567&lt;/Number&gt;&lt;ExpiresAy&gt;01&lt;/ExpiresAy&gt;&lt;ExpiresYil&gt;13&lt;/ExpiresYil&gt;&lt;Cvv2Val&gt;123&lt;/Cvv2Val&gt;" + "&lt;Total&gt;10&lt;/Total&gt;&lt;Taksit&gt;&lt;/Taksit&gt;&lt;Kdv&gt;xx&lt;/Kdv&gt;&lt;BankaID&gt;1&lt;/BankaID&gt;&lt;TcKimlik&gt;12345678912&lt;/TcKimlik&gt;&lt;/CC5Request&gt;"; </code></pre> <p>Next, you need to get the bytes[] from your form data.</p> <pre><code>byte[] byteArray = Encoding.UTF8.GetBytes(ali); </code></pre> <p>Set some headers:</p> <pre><code>req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = byteArray.Length; req.Method = "POST"; </code></pre> <p>Now write your data to the request stream.</p> <pre><code>Stream dataStream = req.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); </code></pre> <p>Finally... get your response. Also note, anything that implements IDisposable should be wrapped in a <code>using</code> statement, i.e. <code>Stream</code> and <code>WebResponse</code>.</p> <p>Also note that the submit button is not part of your form post data. It's possible the server is expecting it.</p> <p>Edit: Here's a complete example from Microsoft that guides you step by step.</p> <p><a href="http://msdn.microsoft.com/en-us/library/debx8sh9.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/debx8sh9.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload