emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: news1142@karl-voit.at
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Wanted: volunteer to integrate REST-client (restclient.el)
Date: Sat, 8 Feb 2014 19:18:31 -0500	[thread overview]
Message-ID: <CAJ51ETrd-zi0UDLaunGkz_2PzCyuHFYFUhtwZez6HJkbdRhA4w@mail.gmail.com> (raw)
In-Reply-To: <2014-02-07T14-30-02@devnull.Karl-Voit.at>

[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]

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 <devnull@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
>
>
>

[-- Attachment #2: Type: text/html, Size: 3453 bytes --]

  reply	other threads:[~2014-02-09  0:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 13:35 Wanted: volunteer to integrate REST-client (restclient.el) Karl Voit
2014-02-09  0:18 ` John Kitchin [this message]
2014-02-10 13:13   ` Karl Voit
2014-02-10 15:59     ` John Kitchin
2014-02-12 15:02       ` OT: installing pip on Windows/Cygwin (was: Wanted: volunteer to integrate REST-client (restclient.el)) Karl Voit
2014-02-12 16:12         ` Karl Voit
2014-02-12 17:08         ` John Kitchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ51ETrd-zi0UDLaunGkz_2PzCyuHFYFUhtwZez6HJkbdRhA4w@mail.gmail.com \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@karl-voit.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).