all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pitclaudel@live.com>
To: 23253@debbugs.gnu.org
Subject: bug#23253: 25.0.90; url-retrieve ignores url-mime-accept-string and most other url variables
Date: Sat, 9 Apr 2016 14:51:58 -0400	[thread overview]
Message-ID: <57094F4E.7080207@live.com> (raw)


[-- 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 --]

             reply	other threads:[~2016-04-09 18:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-09 18:51 Clément Pit--Claudel [this message]
2019-05-15  4:38 ` bug#23253: 25.0.90; url-retrieve ignores url-mime-accept-string and most other url variables Lars Ingebrigtsen

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=57094F4E.7080207@live.com \
    --to=clement.pitclaudel@live.com \
    --cc=23253@debbugs.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.