Sigo con el problema, he encontrado en al API la siguiente info:
Cita:
Creating an empty document
Here is an example of creating a document by uploading metadata to the server with an HTTP POST request. This will create an empty document called new document on Google Documents.
POST /feeds/default/private/full HTTP/1.1Host: docs.google.comGData-Version: 3.0Content-Length: 287Content-Type: application/atom+xml<?xml version='1.0' encoding='UTF-8'?><entry xmlns="http://www.w3.org/2005/Atom"> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document"/> <title>new document</title></entry>
|
he puesto este codigo en mi aplicacion pero me da un error de autenticacion, aunque el asunto del acceso esta resuelto ya que si puedo añadir informacion a una hoja previamente creada.
Código Delphi
[-]
procedure TfrMain.btnCrearClick(Sender: TObject);
var
res, StrData, FromAttr: String;
postStream: TStream;
resStream: TStringStream;
begin
fromAttr:='http://docs.google.com';
StrData:='+QuotedStr('1.0')+' encoding=' +QuotedStr('UTF-8')+ '?> '+
' ' +
'+
'term="http://schemas.google.com/docs/2007#document"/> ' +
'new document ' +
' ';
try
Altas.Request.CustomHeaders.Values ['Authorization'] := 'GoogleLogin auth=' + googleAuth.AuthString;
Altas.Request.CustomHeaders.Values ['Content-type'] := 'application/atom+xml';
Altas.Request.CustomHeaders.Values ['GData-Version'] := '2.0';
Altas.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(Altas);
postStream := TStringStream.Create (strData);
showmessage(StrData);
postStream.Position := 0;
res := Altas.Post (fromAttr, postStream);
showmessage(res);
Except
on e: Exception do
Showmessage(e.ClassName+': '+e.Message);
end;
end;
Vuelvo a poner esta parte porque en la parte de arriba no me lo respeta, no se porque, en edicion se ve completo pero ya guardado aparece incompleto.
StrData:='<?xml version='+QuotedStr('1.0')+' encoding=' +QuotedStr('UTF-8')+ '?> '+
'<entry xmlns="http://www.w3.org/2005/Atom"> ' +
'<category scheme="http://schemas.google.com/g/2005#kind" '+
'term="http://schemas.google.com/docs/2007#document"/> ' +
'<title>new document</title> ' +
'</entry> ';
Sigo esperando que alguien me pueda ayudar, Saludos y gracias de antemano.