[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/with-url 20c089e 3/6: Default to no encoding in he
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] scratch/with-url 20c089e 3/6: Default to no encoding in headers |
Date: |
Mon, 23 Jan 2017 20:42:28 +0000 (UTC) |
branch: scratch/with-url
commit 20c089e3bc11b91731e5b7f15de217dda56362e5
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Default to no encoding in headers
Fix quotes for default parameters
---
lisp/url/with-url.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/lisp/url/with-url.el b/lisp/url/with-url.el
index 7388aa0..72e7886 100644
--- a/lisp/url/with-url.el
+++ b/lisp/url/with-url.el
@@ -59,9 +59,9 @@
debug
headers
ignore-errors
- (method 'get)
+ (method ''get)
data
- (data-charset 'utf-8)
+ (data-charset ''utf-8)
data-encoding)
&body body)
"Retrieve URL and execute BODY with point in a buffer with the response.
@@ -166,11 +166,11 @@ and `base64'."
:debug ,debug
:cookies ,cookies
:cache ,cache
- :headers ',headers
- :method ',method
+ :headers ,headers
+ :method ,method
:ignore-errors ,ignore-errors
:data ,data
- :data-charset ',data-charset
+ :data-charset ,data-charset
:data-encoding ,data-encoding
:start-time (current-time)
:last-read-time (current-time)
@@ -413,7 +413,7 @@ If given, return the value in BUFFER instead."
(let* ((data (with-url--data req))
(headers
(list
- (list 'user-agent (url-http-user-agent-string))
+ (list 'user-agent (url-http-user-agent))
(list 'connection "close")
(list 'accept-encoding
(and (fboundp 'zlib-available-p)
@@ -463,7 +463,7 @@ If given, return the value in BUFFER instead."
(car defaults))
(t
'utf-8)))
- (encoding (or (nth 3 header) (nth 1 defaults) 'url-encode))
+ (encoding (or (nth 3 header) (nth 1 defaults)))
(value (nth 1 header)))
;; Allow symbols and numbers as values for convenience.
(unless (stringp value)
@@ -474,8 +474,9 @@ If given, return the value in BUFFER instead."
(insert (pcase encoding
(`puny (puny-encode-string value))
(`base64 (base64-encode-string value t))
- (_ (url-hexify-string value))))
- (insert "\n")))
+ (`url-encode (url-hexify-string value))
+ (_ value)))
+ (insert "\r\n")))
(defun with-url--debug (type string)
(with-current-buffer (get-buffer-create "*url-debug*")
- [Emacs-diffs] scratch/with-url updated (0013b14 -> 24f6e46), Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 2e0a3a6 5/6: Make form submission work with with-url, Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 6ed787f 4/6: with-url now uses 'get, not "GET", Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 386c924 1/6: Switch headers to symbols instead of strings, Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 5745c3f 2/6: Use symbols for the get/post method instead of strings, Lars Ingebrigtsen, 2017/01/23
- [Emacs-diffs] scratch/with-url 20c089e 3/6: Default to no encoding in headers,
Lars Ingebrigtsen <=
- [Emacs-diffs] scratch/with-url 24f6e46 6/6: Refactor the user-agent function for reuse, Lars Ingebrigtsen, 2017/01/23