I think you could do this via requests directly. It could be done in emacs:
https://github.com/tkf/emacs-request

or python: http://docs.python-requests.org/en/latest/

In your case you could have a block like this:

#+BEGIN_SRC python
import requests
headers = {"Authorization": "Basic YmVfcmVzdF9hZG1",
           "Accept-Encoding": "application/xml"}
r = requests.get("http://myserver/rest/dothis";, headers=headers)
print r.text
#+END_SRC


John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Fri, Feb 7, 2014 at 8:35 AM, Karl Voit <devn...@karl-voit.at> wrote:

> Hi!
>
> I am not an ELISP programmer (unfortunately) but a proud heavy-user
> of Org-mode. At work, I need a REST-client to talk to a REST API
> very often.
>
> Recently, I found [1] which works quite well. However, I need to
> open a new buffer into restclient-mode to execute requests.
>
> Wouldn't it be nice if Org-mode could integrate this tool so that,
> e.g., following example could be invoked via babel?
>
>     #+BEGIN_SRC REST
>     GET http://myserver/rest/dothis
>     Authorization: Basic YmVfcmVzdF9hZG1
>     Accept-Encoding: application/xml
>     #+END_SRC
>
>     #+RESULTS:
>     : <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>     : <faultInfo xmlns="http://example.com/product/model";>
>     :   <...>
>     : </faultInfo>
>
> I also proposed this as a request on [2] but the author is not using
> Org-mode on a regular basis.
>
> So: is there any volunteer who wants to complete Org-mode's
> featureset even more?
>
> Thanks!
>
>   1. https://github.com/pashky/restclient.el
>   2. https://github.com/pashky/restclient.el/issues/21
> --
> mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
>        > get Memacs from https://github.com/novoid/Memacs <
>
> https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on
> github
>
>
>

Reply via email to