diff --git a/wttrin.el b/wttrin.el index 512b6a7..0c9dbe5 100644 --- a/wttrin.el +++ b/wttrin.el @@ -27,7 +27,7 @@ :group 'wttrin :type 'list) -(defcustom wttrin-default-accept-language '("Accept-Language" . "en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4") +(defcustom wttrin-default-accept-language "en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4" "Specify default HTTP request Header for Accept-Language." :group 'wttrin :type '(list) @@ -35,8 +35,8 @@ (defun wttrin-fetch-raw-string (query) "Get the weather information based on your QUERY." - (let ((url-request-extra-headers '(("User-Agent" . "curl")))) - (add-to-list 'url-request-extra-headers wttrin-default-accept-language) + (let ((url-user-agent "curl") + (url-mime-language-string wttrin-default-accept-language)) (with-current-buffer (url-retrieve-synchronously (concat "http://wttr.in/" query)