如何在vb.net中发出POST请求
我。我正在使用 Visual Studio 8 使用 vb.net。我正在尝试发出符合以下架构的发布请求,但失败得很惨。
<?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>
我不确定我需要做什么才能发布投注。我已经多次尝试以正确的形式发布我认为正确的信息,使用 postStream = myWebRequest.GetRequestStream() postStream.Write(bytedata, 0, bytedata.Length) 但到目前为止,我得到的只是一个错误,文件过早结束。 请任何人帮忙。感谢您的所有贡献。
i. I am using visual studio 8 using vb.net. I am trying to make a post request that complies with the following schema, but am failing miserably.
<?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 am not sure what I need to do to post to make the bet.I have had many goes at posting what thought was the correct information in the correct form, using
postStream = myWebRequest.GetRequestStream()
postStream.Write(bytedata, 0, bytedata.Length)
But thus far all I get is an error, premature end of file.
Please can anyone help. Thanks for all contributions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 Sonny Boy 所建议的,您忽略了在文件末尾添加 a 。
(社区维基,只是想正式回答这个问题。)
As suggested by Sonny Boy, you have neglected to include a at the end of the file.
(Community Wiki, just trying to get this question officially answered.)
这是您的示例的正确格式,但我需要更多信息才能为您提供完整的解决方案。
This is the correct format to your example, but i need more information to give you a complete solution.