Hi.

I'm trying to write a VB app using WinINet to update my Google
Calendar.  I can authenticate, but when I try to create an event I
return a 405 error

"Method Not Allowed

The request method POST is inappropriate for the URL /calendar/feeds/
default/private/full."

I'm sure I'm getting something very simple wrong, and I'm hoping
someone out there can see what it is.

Thanks for your help
Russell


Here's the relevant code extract


    sFormData = getQuickEventCode()

    hInternetSession = InternetOpen(scUserAgent,
INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
    hInternetConnect = InternetConnect(hInternetSession, "google.com",
INTERNET_DEFAULT_HTTP_PORT, "", "", INTERNET_SERVICE_HTTP, 0, 0)
    hHttpOpenRequest = HttpOpenRequest(hInternetConnect, "POST", "/
calendar/feeds/default/private/full", vbNullString, vbNullString, 0,
INTERNET_FLAG_KEEP_CONNECTION, 0)

    sHeader = "Content-Type:application/atom+xml" & vbCrLf
    iRetVal = HttpAddRequestHeaders(hHttpOpenRequest, sHeader, Len
(sHeader), HTTP_ADDREQ_FLAG_REPLACE Or HTTP_ADDREQ_FLAG_ADD)

    sHeader = "Authorization: GoogleLogin auth=" & AuthCode & vbCrLf
    iRetVal = HttpAddRequestHeaders(hHttpOpenRequest, sHeader, Len
(sHeader), HTTP_ADDREQ_FLAG_REPLACE Or HTTP_ADDREQ_FLAG_ADD)

    iRetVal = HttpSendRequest(hHttpOpenRequest, vbNullString, 0,
sFormData, Len(sFormData))

...

Function getQuickEventCode() As String

    getQuickEventCode = "<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:gCal='http://schemas.google.com/gCal/2005'>" & vbCrLf & _
                        "<content type='html'>Tennis with John April
11 3pm-3:30pm</content>" & vbCrLf & _
                        "<gCal:quickadd value='true'/>" & vbCrLf & _
                        "</entry>"
End Function

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to