unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Questions about the (web client) module.
@ 2017-07-20 10:53 Roel Janssen
  2017-07-20 15:41 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Roel Janssen @ 2017-07-20 10:53 UTC (permalink / raw)
  To: guile-user

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-21  5:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-20 10:53 Questions about the (web client) module Roel Janssen
2017-07-20 15:41 ` Ludovic Courtès
2017-07-20 22:36   ` Roel Janssen
2017-07-21  4:49     ` Mark H Weaver
2017-07-21  5:05     ` Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).