emacs-devel
[Top][All Lists]
Advanced

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

Why does url-retrieve ignore url-mime-accept-string and most other url v


From: Clément Pit--Claudel
Subject: Why does url-retrieve ignore url-mime-accept-string and most other url variables?
Date: Tue, 29 Mar 2016 11:52:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

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: signature.asc
Description: OpenPGP digital signature


reply via email to

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