chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] curl egg


From: Sven Hartrumpf
Subject: Re: [Chicken-users] curl egg
Date: Mon, 03 Aug 2015 16:24:40 +0200 (CEST)

Peter Bex <address@hidden> schrieb am Mon, 3 Aug 2015 15:00:31 +0200:
> On Mon, Aug 03, 2015 at 02:46:53PM +0200, Sven Hartrumpf wrote:
>> Peter Bex <address@hidden> schrieb am Mon, 3 Aug 2015 10:15:57 +0200:
>> > Out of curiosity, is there something important missing in the http-client
>> > egg, or are you trying to port some CHICKEN 3 code that used the curl egg?
>> 
>> The former.
>> I cannot find a way in http-client to specify a file attachment for 
>> sendgrid's API.
>> curl uses this syntax:
>> curl ... -F address@hidden;type=application/pdf
>> 
>> (see 
>> https://sendgrid.com/docs/API_Reference/Web_API/mail.html#-Send-a-test-specifying-the-file-content-type-by-appending-typemime-type-to-the-file-name
>>  )
>> 
>> The last line (marked *** below) is my best try so far, but it does not work:
>> 
>>                      (rest-action
>>                        "https://api.sendgrid.com/api/mail.send.json";
>>                        'PUT
>>                        `(
>>                          (api_user . "...")
>>                          (api_key . "...")
>>                          (to . ,to-address)
>>                          (from . "info@")
>>                          (subject . ,subject)
>>                          (,(if html? 'html 'text) . ,text)
>>                          (,(string->symbol (string-append "files[" 
>> attachment "]")) file: ,attachment filename: ,attachment headers: 
>> ((content-type ,attachment-type))) ; ***
>>                          ))
> 
> Have you updated to the latest intarweb and http-client eggs?  I got a
> bugreport from Ryan Senior that precisely this part wasn't working; it
> raised an exception.  This bug has been fixed in version 0.8 of
> http-client.

My versions were too old.
Thanks for the hint, Peter,
and for the bug report, Ryan.

Ciao
Sven



reply via email to

[Prev in Thread] Current Thread [Next in Thread]