title: How To Send The Body Of Http Post Request using HTTPWebRequest
body: <p>I just want to POST a body data in a x-www-form-urlencoded format in a specific URL. I searched a lot but I only found how to send a parameter in an HTTP request post in VB.NET.</p>
  
  <p>This is my code, but when I see the output it is just sending the post parameter:</p>
  
  <pre><code>Try
  
      Dim TextBox10 = "12637"
      Dim request As WebRequest = WebRequest.Create("https://ptsv2.com/t/delh1-1545643919")
      request.Method = "POST"
  
      Dim postbody As String = "employee_id=" + TextBox1.Text + "&amp;company_code=" + TextBox2.Text + "&amp;reg_key=" + TextBox3.Text + ""
      Dim requestBody As String = "FormFieldName=Hello+World!"
      Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postbody)
      request.ContentType = "application/x-www-form-urlencoded"
      request.ContentLength = byteArray.Length
      Dim dataStream As Stream = request.GetRequestStream()
      dataStream.Write(byteArray, 0, byteArray.Length)
      dataStream.Close()
      Dim response As WebResponse = request.GetResponse()
      Console.WriteLine((CType(response, HttpWebResponse)).StatusDescription)
      dataStream = response.GetResponseStream()
      Dim reader As StreamReader = New StreamReader(dataStream)
      Dim responseFromServer As String = reader.ReadToEnd()
      TextBox4.Text = responseFromServer
  
      Console.WriteLine(responseFromServer)
  
      'Clean up the streams.  
      reader.Close()
      dataStream.Close()
      response.Close()
  
  Catch ex As Exception
      MsgBox("NO DATA FOUND / CHECK INTERNET CONNECTION")
      TextBox4.Text = ""
      TextBox3.Text = ""
      TextBox2.Text = ""
  End Try
  </code></pre>
  
  <p>This is the output of the posted code:</p>
  
  <p><img src="https://i.stack.imgur.com/nc9EC.png" alt="THIS IS THE IMAGE OF THE OUTPUT OF THE CODE POST"></p>
  
  <p>How should I send the body data?</p>