If you're using the http package to do REST with content type negotiation, you need to configure the package's <tt>Accept:</tt> types mechanism from time to time. This is a bit of a broken API, in that there's no option to override from options passed to <tt>http::geturl</tt>. This is not the feature change I'm requesting.
<p>
<i>However,</i> if you're also using asynchronous connecting then you've got an additional problem in that the configuration of the <tt>-accept</tt> option is only read when the connection is made; two connections that require different <tt>Accept:</tt> headers will have a race condition between the two, and so which is used will be pretty much random. <b>This Is Wrong.</b> This is the bug I'm reporting.
<p>
Suggested fix, <i>without fixing the original API botch,</i> is to take a copy of <tt>$http(-accept)</tt> into the <tt>state</tt> array during <tt>http::geturl</tt> so that the value used in <tt>http::Connected</tt> is predictable.
<p>
See also: <a thread</a> with the comment that prompted me to look into the potential feature request, and discover the race:
<blockquote><tt><i>Ok well the final solution was that using -headers in the http::geturl doesn't seem to work when setting an "Accept" header - which kind of