guile-user
[Top][All Lists]
Advanced

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

Questions about the (web client) module.


From: Roel Janssen
Subject: Questions about the (web client) module.
Date: Thu, 20 Jul 2017 12:53:23 +0200
User-agent: mu4e 0.9.18; emacs 25.1.1

Dear Guilers,

When I use http-post, and I want to change the HTTP header called
"Content-Type", I seem to need to spell it as "content-type" in the
#:headers part of the 'http-post' section.  Other headers like "Accept"
do not seem to follow the same lowercase style route.

More confusingly, using something like:
  #:headers '((Content-Type . "text/csv"))

leads to outputting the "Content-Type" header twice.
Why is "content-type" special?


Then my next question is about "multipart/form-data" content types.
My code looks like this:

  #:headers `((content-type . ,(string-append
                                "multipart/form-data; boundary=" boundary))
              (Accept . "*/*"))

But that does not work:
  scheme@(guile-user)> 
  web/request.scm:184:10: In procedure build-request:
  web/request.scm:184:10: Bad request: Bad value for header content-type: 
"multipart/form-data; boundary=..."

This is, however, a valid Content-Type.

So, why does content-type need to be spelled out lowercased?
And why can't it handle "multipart/form-data"?

Kind regards,
Roel Janssen



reply via email to

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