List Info

Thread: Posting events using VisualBasic and WinHttp.WinHttpRequest.5.1




Posting events using VisualBasic and WinHttp.WinHttpRequest.5.1
user name
2006-10-28 12:30:01

Maybe somebidy can help me. I'm trying using the upcoming.org API
through VB and WinHttp.WinHttpRequest.5.1. For methods that uses GET
everithing is working fine but when I'm trying to use POST for example
for vanue.add I have an error

Method not found - Check that you are using the proper Method for the
resource (i.e. GET or POST)

I tried the same parameters using cURL and everithing was working
correct. So api_key and token are correct.

My code is:
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
strUrl = "http://www.upcoming.org/services/rest/"
strPostData =
"api_key=<API_Key>;&method=venue.add&token=<Token>&name=test&amp;venueaddress=none&amp;metro_id=332&private=1&quot;

objHTTP.Open "POST", strURL, False
objHTTP.SetRequestHeader "content-type&quot;,
&quot;application/x-www-form-urlencoded"
objHTTP.Option(WinHttpRequestOption_UserAgentString) = strUserAgent
objHTTP.Send strPostData

And returned xml
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8"?>
<rsp stat=";fail">
<error msg="Method not found - Check that you are using the proper
Method for the resource (i.e. GET or POST)"; />
<;/rsp>

Please, help me if you have any ideals. Thanks a lot.

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )