all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pit@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Why does url-retrieve ignore url-mime-accept-string and most other url variables?
Date: Tue, 29 Mar 2016 11:52:49 +0200	[thread overview]
Message-ID: <56FA5071.6080506@gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1276 bytes --]

The doc string of url-retrieve says:

> The variables ‘url-request-data’, ‘url-request-method’ and
> ‘url-request-extra-headers’ can be dynamically bound around the
> request; dynamic binding of other variables doesn’t necessarily
> take effect.

What's the proper way, then, to set ‘url-mime-encoding-string’, ‘url-mime-charset-string’, and ‘url-mime-accept-string’ for a single query? In particular, how come things work with ‘url-retrieve-synchronously’, but not with ‘url-retrieve’?

More precisely: this sends a query with ‘Accept: */*’, and prints nil:

    (let ((url-mime-accept-string "abc/def"))
      (url-retrieve "http://www.gnu.org/software/emacs/"
                    (lambda (&rest _)
                      (message "url-retrieve: %S"
                               url-mime-accept-string))))

but this sends a query with ‘Accept: abc/def’, and prints “abc/def”:

    (let ((url-mime-accept-string "abc/def"))
      (with-current-buffer
          (url-retrieve-synchronously
           "http://www.gnu.org/software/emacs/")
        (message "url-retrieve: %S"
                 url-mime-accept-string)))

Is that a bug? If not, could we document the proper way to set an Accept header?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

                 reply	other threads:[~2016-03-29  9:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56FA5071.6080506@gmail.com \
    --to=clement.pit@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.