RestSharp VB请求 [英] RestSharp VB Request
本文介绍了RestSharp VB请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人提供示例或教程如何使用RestSharp for WP8 VB.Net进行请求吗?
我试过一个很多,但仍有问题......
谢谢
解决方案
< blockquote>
所有您需要的;
$
1)
添加"RestSharp.WindowsPhone.dll"引用。
2)
添加;
VB.NET
Imports RestSharp
3)
以下是获取数据的示例;
VB.NET
Private Sub get_data()
Dim client = New RestClient()
client.BaseUrl =" http://www.bing.com"
Dim request = New RestRequest()
request.Resource =" search?q ="" widget + foo"""
request.Method = Method.POST
client.ExecuteAsync(request,Sub(res)
MessageBox.Show(res.Content)'在这里显示数据内容消息框
结束Sub)
End Sub
4)
最后,只需从你想要的地方调用get_data
希望这会有所帮助......
Has somebody a example or tutorial how to do a request with RestSharp for WP8 VB.Net?
I tried a lot but have still problems...
Thanks
解决方案
All you need;
1)Add "RestSharp.WindowsPhone.dll" to references.
2)
Add;VB.NET
Imports RestSharp3)
Here is the sample to get data;VB.NET
Private Sub get_data() Dim client = New RestClient() client.BaseUrl = "http://www.bing.com" Dim request = New RestRequest() request.Resource = "search?q=""widget+foo""" request.Method = Method.POST client.ExecuteAsync(request, Sub(res) MessageBox.Show(res.Content) 'Show Data Content Here with Message Box End Sub) End Sub4)
Finally, just call get_data from where you wantHope this helps...
这篇关于RestSharp VB请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文