473,508 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make a POST request in vb.net

5 New Member
Hi. I am using visual studio 8, using vb.net. I am trying without success to make a post request to a web form as shown below.


<?xml version="1.0" encoding="UTF-8"?><postBetOrder xmlns="urn:betfair:games:api:v1"marketId="2568540" round="1" currency="GBP">
<betPlace>
<bidType>BACK</bidType>
<price>2.5</price>
<size>2.50</size>
<selectionId>658440</selectionId>
</betPlace>


I encode the information using 'HttpUtility.UrlEncode' and I use
'myWebRequest.ContentLength = bytedata.Length' to get the length and then I use
postStream = myWebRequest.GetRequestStream()
postStream.Write(bytedata, 0, bytedata.Length)
to post, but keep getting a 'premature end of file' error.
I dont think that I am posting the right information. Am i supposed to post just the information or do I post the the tags and the information? This is all very new to me and I really am stuck so if anyone can help I'd be most grateful. Thanks for all and any contributions.
Oct 8 '09 #1
2 3494
Dököll
2,364 Recognized Expert Top Contributor
@smileyc

I am going to send over to .net for a closer look, you'll probably get more hits there:-)
Oct 10 '09 #2
Plater
7,872 Recognized Expert Expert
POST requests can be done a number of ways.
In HTML using a form section
In javascript using the XMLHttpRequest object
In backend code vbnet(or any .NET language) using the HttpWebRequest object

Be sure to set the method to "POST" as it defaults to "GET"
Oct 12 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3261
by: Keith Selbee | last post by:
I am trying to submit data to a webpage in the form of a post and my code is below. It is a function that takes a url and the post content as strings and then performs the post. But as soon as I...
1
5525
by: Kueishiong Tu | last post by:
I have a .net window form application but I have to get data from various web sites. How do I make Http request (preferrably via post method) from a window form to get the data from those web...
0
3860
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
3
6864
by: Patrick Fogarty | last post by:
I am programming what is to be a web service client that will use an HTTP-POST to request and retrieve data. The remote server (written in java for what it's worth) requires basic authentication...
6
4841
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
2
5963
by: rup | last post by:
Hello, This is my first application on socket programming in vc++. I am facing problem that how to make connection to server, & make GET/POST request by HTTP. Please help me. Its urgent.......
7
9645
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Make CStr for JavaScript on ASP w/ Request.Form and QueryString In ASP, Request.Form and Request.QueryString return objects that do not support "toString", or any JavaScript string...
2
6275
by: MDANH2002 | last post by:
Hi From VB.NET I want to simulate the POST request of the following HTML form <html> <title>HTTP Post Testing</title> <body> <form action=http://www.example.com/postdata ...
6
8273
by: 703designs | last post by:
I'm writing a little Drupal module that implements a couple forms, relaying the submitted values to a third-party site. I know the target URL and I have all of the values that I want to submit with...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7336
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
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7066
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...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.