如何在vb.net中发出POST请求

发布于 2024-08-06 11:45:58 字数 609 浏览 2 评论 0原文

我。我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清风不识月 2024-08-13 11:45:58

正如 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.)

我很坚强 2024-08-13 11:45:58
<?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>
*</postBetOrder>*

这是您的示例的正确格式,但我需要更多信息才能为您提供完整的解决方案。

<?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>
*</postBetOrder>*

This is the correct format to your example, but i need more information to give you a complete solution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文