Christian ,

Thanks for your valuable help.

After i succeeded to use the OO connection stuff to use Google Translations i was tempted to use the newest Google Tasks API too.

Using port 443  i get no respons at all ?
I left my API_Key out for security reasons.

In my working code for Translations i used

so i am a bit confused about the syntax to make HHTP requests :-)

sub GoogleTranslate
cCR = Chr(13)
cLF = Chr(10)
oConnector = createUnoService("")
oConnection = oConnector.connect("socket,,port=80") 'je%20suis%20au%20l'intérieur%20du%20magazin
sToTranslate = "voetbal"
sSourceLang = "nl"
sTargetLang = "en"
oConnection.write( StringToByteArray( "GET"&; sToTranslate & "&langpair=" & sSourceLang & "|" & sTargetlang + cCR + cLF+ cCR +cLF ) )
aByteArray  = Array()
nBytesRead =, 1000)
oPipe = createUNOService ("") ' heeft zowel een In als OUtput stream
oTextInp = createUNOService ("") 'kan lezen
oTextOut = createUNOService ("")' kan schrijven
oTextInp.setInputStream(opipe) 'maakt dat pipe kan lezen
otextOut.setOutputStream(opipe) 'maakt dat pipe kan schrijven
otextOut.writestring(ByteArrayToString(aByteArray)) 'schrijft de string naar Pipe
s = oTextinp.readstring(Array("}"), true)
end sub

Hi Fernand, *,

On Wed, May 25, 2011 at 9:24 AM, Fernand Vanrie<>  wrote:
I trie to connect to Googleapis using OO and https ?

oConnector = createUnoService("")
oConnection = oConnector.connect("socket,,port=80")
first: don't know whether it is  supported by OOo like this, but your
example has several general problems, so here we go...

If you want to use ssl, then you should try with the default ssl-port (443)

oConnection.write( StringToByteArray( "GET
And http GET doesn't include the hostname, just the path. Specify the
host in the Host parameter.


and you're not supposed to write it twice either, but maybe I'm
getting things wrong here.
And obviously "YOUR_API_KEY" is to be replaced by your API key.

GET /path/to?param=value&param2=value2 HTTP/1.1
Connection: close

(well, connection: close as it is the only request, you can also just
use http 1.0 request that only have one request at a time anyway)


To unsubscribe send email to
For additional commands send email to
with Subject: help

Reply via email to