all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23253: 25.0.90; url-retrieve ignores url-mime-accept-string and most other url variables
@ 2016-04-09 18:51 Clément Pit--Claudel
  2019-05-15  4:38 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Clément Pit--Claudel @ 2016-04-09 18:51 UTC (permalink / raw)
  To: 23253


[-- Attachment #1.1: Type: text/plain, Size: 1895 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.

It seems that there is no way to set ‘url-mime-encoding-string’, ‘url-mime-charset-string’, and ‘url-mime-accept-string’ for a single asynchronous query (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)))

If this is exepcted, could we document the proper way to set an Accept header?

Clément.

In GNU Emacs 25.0.90.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2016-02-23 built on clem-w50-mint
Repository revision: f1dc3dc63ae4e454ca0e98eebbd80f0ba9d5c356
Windowing system distributor 'The X.Org Foundation', version 11.0.11501000
System Description:	Linux Mint 17.3 Rosa

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix



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

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

* bug#23253: 25.0.90; url-retrieve ignores url-mime-accept-string and most other url variables
  2016-04-09 18:51 bug#23253: 25.0.90; url-retrieve ignores url-mime-accept-string and most other url variables Clément Pit--Claudel
@ 2019-05-15  4:38 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-05-15  4:38 UTC (permalink / raw)
  To: Clément Pit--Claudel; +Cc: 23253

Clément Pit--Claudel <clement.pitclaudel@live.com> writes:

> It seems that there is no way to set ‘url-mime-encoding-string’, ‘url-mime-charset-string’, and ‘url-mime-accept-string’ for a single asynchronous query (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))))

I tried this, and I got

url-retrieve: "abc/def"

so this has apparently been fixed in Emacs 27?  Closing the bug.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2019-05-15  4:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-09 18:51 bug#23253: 25.0.90; url-retrieve ignores url-mime-accept-string and most other url variables Clément Pit--Claudel
2019-05-15  4:38 ` Lars Ingebrigtsen

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.