google gadget and sites api
Asked Answered
M

2

8

I'm writing a google gadget (nothing but plain html + javascript) to upload a file onto a private google site using the sites api. http://code.google.com/apis/sites/docs/1.0/developers_guide_protocol.html#UploadingFiles

I can only upload the file using a multi-part form. But it doesn't work because the api needs oauth authentication. Authetication involves setting some header fields in the POST request. Unfortunately form submit does not let us set the header, thus no authentication. I can't make an ajax call because of cross-domain restrictions. Any ideas on what can be done?

One way I can think of is to use a proxy which makes the authenticated call, but I want to avoid that. I need a javascript-only way of doing it.

Melville answered 6/1, 2010 at 6:44 Comment(0)
T
1

post to a server side script and initiate a curl request with all the headers you want?

Taritariff answered 19/7, 2012 at 12:21 Comment(0)
G
0

I'm looking at the same problem. I now found Google APIs Client Library for JavaScript. I don't know if it supports Google Sites, but I plan to try.

Gerhardine answered 15/1, 2014 at 8:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.