[Gambas-user] CURL: Custom outgoing headers

shannon at ...2384... shannon at ...2384...
Mon Mar 8 04:26:37 CET 2010


awesome! for now I just used gb.net to manually do it. Related question: sending a jpg as POST data - open the file as sring? byte? I've tried all without success. Any guidance would be helpful!

Thanks for everything!

Shan
-----Original Message-----
Date: Sunday, March 07, 2010 9:23:18 pm
To: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
From: "Benoît Minisini" <gambas at ...1...>
Subject: Re: [Gambas-user] CURL: Custom outgoing headers

> I'm trying to connect to a server that requires a custom header. I'm using
> CURL and Gambas v2.13. I can't find a way to modify the outgoing headers.
> 
> Here's my code snippet:
> 
>   DIM mySock AS HttpClient
>   DIM myResponse AS String
>   DIM myRequest AS String
>   DIM AuthToken as String
> 
>    AuthToken = "TESTTOKEN"
> 
>     mySock = NEW HttpClient
>     myRequest = makeJSON(TextBox1.Text, myParent)
> 
>     MySock.Async = FALSE
>     MySock.Timeout = 60
>     mySock.url = "http://www.zenfolio.com/api/1.2/zfapi.asmx"
> 
> 
>     MySock.Headers = ["X-Zenfolio-Token: " & AuthToken]
>     MySock.Post("application/json", myRequest)

This is not possible at the moment. I plan to add that for Gambas 3, and may 
be I will be able to backport it to Gambas 2 as it does not introduce any 
change in the API.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed co





More information about the User mailing list