Dim hj As HttpJob
url = "https://spreadsheets.google.com/feeds/list/"&Main.SheetKey&"/"&WorksheetID&"/Private/full?access_token="&AccessToken"
param = "{""E&"username""E&" : ""E&username"E&", ""E&"email""E&" : ""E&EmailAdr"E&"}"
hj.Initialize("UpdateTask",Me)
Log("param="¶m)
hj.PostString(url, param)
Dim jg As JSONGenerator
jg.Initialize(CreateMap("username": username, "email": EmalAdr))
Log(jg.ToString)
Content-Type application/x-www-form-urlencoded is not a valid input type.
java.lang.Exception: Sub jobdone signature does not match expected signature.
Sub RegisterUser
Dim hj As HttpJob
url = "https://spreadsheets.google.com/feeds/list/"&Main.SheetKey&"/"&WorksheetID&"/Private/full?access_token="&AccessToken
Dim jg As JSONGenerator
jg.Initialize(CreateMap("username": username.Text, "email": EmailAdr.Text))
Log(jg.ToString)
hj.Initialize("UpdateTask",Me)
hj.GetRequest.InitializePost2(url,jg.ToString.GetBytes("UTF8"))
hj.GetRequest.SetHeader("Content-type", "application/atom+xml")
hj.GetRequest.SetHeader("GData-Version", "3.0")
hj.GetRequest.SetHeader("charset","UTF-8")
hj.GetRequest.SetHeader("type","entry")
hj.GetRequest.SetContentType("application/atom+xml")
Log(url)
hj.PostString(url,jg)
End Sub
Content-Type application/x-www-form-urlencoded is not a valid input type.
java.lang.Exception: Sub jobdone signature does not match expected signature.
Sub RegisterUser
Dim hj As HttpJob
url = "https://spreadsheets.google.com/feeds/list/"&Main.SheetKey&"/"&WorksheetID&"/Private/full" '?access_token="&AccessToken
Dim xb As XMLBuilder
xb = xb.create("entry").attr("xmlns","http://www.w3.org/2005/Atom").attr("xmlns:gsx","http://schemas.google.com/spreadsheets/2006/extended")
xb = xb.e("gsx:timestamp").text(DateTime.Date(DateTime.Now)).up
xb = xb.e("gsx:username").text(username.Text).up
xb = xb.e("gsx:email").text(EmailAdr.Text).up
Log(xb.asString)
hj.Initialize("UpdateTask",Me)
hj.GetRequest.InitializePost2(url,xb.asString.GetBytes("UTF8"))
'hj.GetRequest.SetHeader("Content-type", "application/atom+xml")
hj.GetRequest.SetHeader("GData-Version", "3.0")
hj.GetRequest.SetHeader("Authorization", "OAuth "&AccessToken)
hj.GetRequest.SetContentType("application/atom+xml")
hj.PostString(url,xb.asString)
End Sub
POST https://spreadsheets.google.com/feeds/list/----spreadsheetkeyhere----/od8/Private/full HTTP/1.1
Content-Length: 236
Content-Type: application/x-www-form-urlencoded
Host: spreadsheets.google.com
Connection: Keep-Alive
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended"><gsx:timestamp>05/16/2014</gsx:timestamp><gsx:username>myusername</gsx:username><gsx:email>[email protected]</gsx:email></entry>
Sub RegisterUser
Dim hj As HttpJob
url = "https://spreadsheets.google.com/feeds/list/"&Main.SheetKey&"/"&WorksheetID&"/Private/full?access_token="&AccessToken
Dim jg As JSONGenerator
jg.Initialize(CreateMap("username": username.Text, "email": EmailAdr.Text))
Log(jg.ToString)
hj.Initialize("UpdateTask",Me)
'hj.GetRequest.InitializePost2(url,jg.ToString.GetBytes("UTF8"))
hj.PostString(url,jg)
hj.GetRequest.SetHeader("GData-Version", "3.0")
hj.GetRequest.SetHeader("Authorization", "OAuth "&AccessToken)
hj.GetRequest.SetContentType("application/atom+xml")
Log(url)
End Sub
java.lang.Exception: Sub jobdone signature does not match expected signature.
HTTP/1.1 201 Created
Content-Type: application/atom+xml; charset=UTF-8; type=entry
Expires: Fri, 16 May 2014 15:03:35 GMT
Date: Fri, 16 May 2014 15:03:35 GMT
Cache-Control: private, max-age=0, must-revalidate, no-transform
Vary: Accept, X-GData-Authorization, GData-Version
GData-Version: 3.0
ETag: "RlkXIG0sMit7ImA9Xk9aRhRT"
Location: https://spreadsheets.google.com/feeds/list/-----worksheetkeyhere------/od8/private/full/d180g
Content-Location: https://spreadsheets.google.com/feeds/list/-----worksheetkeyhere------/od8/private/full/d180g
Transfer-Encoding: chunked
Set-Cookie: NID=67=PZoOO1HyUJRijcgtXdFUNkn10YbwatVRZm_TOBKqNyb6M3yicTBgxCr1ROuTUPbaNe6lbR7m7Q1Z5yEtnOjWEo1hD9fELaBPG_vNC0XSNCk3tY04Y8a8lJWq0qyidTS9IH93Gt-aIrsCirkkzMyBNEhE;Domain=.google.com;Path=/;Expires=Sat, 15-Nov-2014 15:03:35 GMT;HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alternate-Protocol: 443:quic
472
<?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gsx='http://schemas.google.com/spreadsheets/2006/extended' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='"RlkXIG0sMit7ImA9Xk9aRhRT"'><id>https://spreadsheets.google.com/feeds/list/-----worksheetkeyhere------/od8/d180g</id><updated>2014-05-16T15:03:35.603Z</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2014-05-16T15:03:35.603Z</app:edited><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title>5/16/2014</title><content>username: myusername, email: [email protected]</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/-----worksheetkeyhere------/od8/private/full/d180g'/><link rel='edit' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/-----worksheetkeyhere------/od8/private/full/d180g'/><gsx:timestamp>5/16/2014</gsx:timestamp><gsx:username>myusername</gsx:username><gsx:email>[email protected]</gsx:email></entry>
0
Sub JobDone(job As HttpJob)
End Sub
Another good catch! This activity is using the sample code provided with the oAuth2 example - GmailContacts - which included a local HttpUtil (not 2) code library. Once I removed the local code references and tweaked it to use httpUtils2, All is Good! Successful transaction, no errors!
Thanks so much for your help on this!
Gentry