On Mon, Aug 03, 2015 at 02:46:53PM +0200, Sven Hartrumpf wrote: > Peter Bex <[email protected]> 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 files\[attachment.pdf\][email protected];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. Cheers, Peter
signature.asc
Description: Digital signature
_______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
