[Top][All Lists]

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

url-retrieve-synchronously results differ from curl

From: Artur Malabarba
Subject: url-retrieve-synchronously results differ from curl
Date: Tue, 20 Jan 2015 00:28:46 -0200

There are further details on this phenomenon at this link

In short, we're trying to do a post request with
`url-retrieve-synchronously', but it's yielding a different result than the
same request using curl. The url request *works*, in that it performs the
post and returns sane results. However, these results are not the expected
ones, and performing the same request using curl does return the expected

It's possible this is just a bug in the API we're posting to, but it's more
likely we just haven't built this request correctly in
url-retrieve-synchronously. This would explain why it's being handled
differently from the request we make with curl. We'd appreciate the input
from anyone who knows more about the `url' package, before we run off
blaming the API. :-)

Less relevant details can be found at the linked question, but below is the
basic url call we're using. The address and data-args variables are defined
elsewhere, but I'm just looking to know whether we're doing something wrong
with the url call.

      (let ((url-automatic-caching t)
            (url-inhibit-uncompression t)
            (url-request-data data-args)
            (url-request-method "post")
             '(("Content-Type" . "application/x-www-form-urlencoded"))))
            (url-retrieve-synchronously address)
          (goto-char (point-min))
          (search-forward "\n\n")
          (delete-region (point-min) (point))

For comparison, here's the curl command we use (which returns different
         (format "curl --silent -X POST --data %S %s"

Thanks a lot
Artur Malabarba

reply via email to

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