From: Lars Ingebrigtsen <larsi@gnus.org>
To: Bjarte Johansen <bjarte.johansen@gmail.com>
Cc: 22855@debbugs.gnu.org
Subject: bug#22855: 24.5; `url-mime-accept-string' not set in asynchronous call
Date: Tue, 01 Mar 2016 14:44:21 +1100 [thread overview]
Message-ID: <87fuwayi96.fsf@gnus.org> (raw)
In-Reply-To: <8DA46E18-FE72-4CE2-9BFA-E49F22A5A841@gmail.com> (Bjarte Johansen's message of "Mon, 29 Feb 2016 17:39:08 +0000")
Bjarte Johansen <bjarte.johansen@gmail.com> writes:
> (let ((url-debug t)
> (url-request-method "POST")
> (url-request-extra-headers
> `(("Content-Type" . "application/x-www-form-urlencoded")))
> (url-request-data
> "query=SELECT%20%3FC%20WHERE%20%7B%5B%5D%20a%20%3FC%7D%20LIMIT%201%0A")
> (url-mime-accept-string "text/csv"))
> (url-retrieve "http://live.dbpedia.org/sparql/"
> #'(lambda (_)
> (message (buffer-string)))))
>
> This will sometimes return a csv file and sometimes an xml file (usually
> the first time). In *URL-DEBUG* you can see that the Accept header is
> not properly set.
The reason it sometimes work is that URL caches connections. If you
(setq url-http-open-connections (make-hash-table :test 'equal :size 17))
before calling, then it'll fail every time.
And the `url-mime-accept-string' variable is just not meant to be used
as an "interface" variable -- it's supposed to be a constant value.
But that really makes no sense, so I'll get fixin'.
I really dislike the `url-retrieve' "interface", where you bind a
gazillion special variables instead of passing in values explicitly.
One of these ... years...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
prev parent reply other threads:[~2016-03-01 3:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 17:39 bug#22855: 24.5; `url-mime-accept-string' not set in asynchronous call Bjarte Johansen
2016-03-01 3:44 ` Lars Ingebrigtsen [this message]
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=87fuwayi96.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=22855@debbugs.gnu.org \
--cc=bjarte.johansen@gmail.com \
/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.