From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: A (probably silly) problem with request.el Date: Fri, 05 Jun 2015 23:26:55 +0200 Message-ID: <87y4jx7so5.fsf@mbork.pl> References: <87bngv89g5.fsf@mbork.pl> <87h9qmsbyn.fsf@members.fsf.org> <87fv668d9f.fsf@mbork.pl> <5571C2EC.90903@members.fsf.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1433539673 9356 80.91.229.3 (5 Jun 2015 21:27:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jun 2015 21:27:53 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 05 23:27:39 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z0z9B-0001Pf-0S for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Jun 2015 23:27:25 +0200 Original-Received: from localhost ([::1]:49671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0z9A-00041L-1d for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Jun 2015 17:27:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0z8z-00041E-Qj for help-gnu-emacs@gnu.org; Fri, 05 Jun 2015 17:27:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0z8v-0002mL-TN for help-gnu-emacs@gnu.org; Fri, 05 Jun 2015 17:27:13 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:36946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0z8v-0002li-L0 for help-gnu-emacs@gnu.org; Fri, 05 Jun 2015 17:27:09 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9DF034FA047 for ; Fri, 5 Jun 2015 23:27:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xe+RhILRV6pt for ; Fri, 5 Jun 2015 23:27:00 +0200 (CEST) Original-Received: from localhost (unknown [109.232.24.146]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 6CE8F4FA03B for ; Fri, 5 Jun 2015 23:26:59 +0200 (CEST) In-reply-to: <5571C2EC.90903@members.fsf.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104781 Archived-At: On 2015-06-05, at 17:40, Nicolas Richard wrote= : > Le 05/06/2015 16:02, Marcin Borkowski a =C3=A9crit : >> On 2015-06-05, at 12:09, Nicolas Richard w= rote: >>> Marcin Borkowski writes: >>>> (require 'request) >>>> (request "http://google.com") >>> >>> Google provides examples of use: >>> http://tkf.github.io/emacs-request/ >>=20 >> I tried them, with similar results. > > What do you expect ? > > The (request ...) form will always (I guess, I did not check the code) > return a structure like the one you pasted. The real job must be done b= y > a callback function. (Probably in the synchronous case it's different, = I > don't know, but as the docstring says: don't use that except for testin= g > purposes.) OK. As I said, my problem is (probably) silly. Now the question is: how do I do anything reasonable with what I got? In my particular case I expect json, so I'd like to use e.g. json.el to convert it to s-exps. How do I do that? I tried (request "http://httpbin.org/get" :parser #'json-read), expecting a sexp, but I still got a structure very much like previously. > Nicolas. TIA, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University