All Projects → zweifisch → Ob Http

zweifisch / Ob Http

Licence: gpl-3.0
make http request within org-mode babel

Projects that are alternatives of or similar to Ob Http

Node Libcurl
libcurl bindings for Node.js
Stars: ✭ 447 (+134.03%)
Mutual labels:  http-client, curl
Lush Http
Smart Http Client for PHP
Stars: ✭ 60 (-68.59%)
Mutual labels:  http-client, curl
Guzzle
Guzzle, an extensible PHP HTTP client
Stars: ✭ 21,384 (+11095.81%)
Mutual labels:  http-client, curl
Kurly
kurly is an alternative to the widely popular curl program, written in Golang.
Stars: ✭ 319 (+67.02%)
Mutual labels:  http-client, curl
Walkman
Write HTTP requests in Org mode and replay them at will using cURL
Stars: ✭ 120 (-37.17%)
Mutual labels:  curl, org-mode
Requests
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.
Stars: ✭ 3,433 (+1697.38%)
Mutual labels:  http-client, curl
Curlie
The power of curl, the ease of use of httpie.
Stars: ✭ 877 (+359.16%)
Mutual labels:  http-client, curl
request-extra
⚡️ Extremely stable HTTP request module built on top of libcurl with retries, timeouts and callback API
Stars: ✭ 14 (-92.67%)
Mutual labels:  curl, http-client
H2c
headers 2 curl. Provided a set of HTTP request headers, output the curl command line for generating that set. Try the converter online at
Stars: ✭ 113 (-40.84%)
Mutual labels:  http-client, curl
Katipo
HTTP2 client for Erlang based on libcurl and libevent
Stars: ✭ 90 (-52.88%)
Mutual labels:  http-client, curl
Insomnia
The open-source, cross-platform API client for GraphQL, REST, and gRPC.
Stars: ✭ 18,969 (+9831.41%)
Mutual labels:  http-client, curl
Curlsharp
CurlSharp - .Net binding and object-oriented wrapper for libcurl.
Stars: ✭ 153 (-19.9%)
Mutual labels:  http-client, curl
Requester
Powerful, modern HTTP/REST client built on top of the Requests library
Stars: ✭ 273 (+42.93%)
Mutual labels:  http-client, curl
Yii2 Httpclient
Yii 2 HTTP client
Stars: ✭ 406 (+112.57%)
Mutual labels:  http-client, curl
Php Curl Class
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
Stars: ✭ 2,903 (+1419.9%)
Mutual labels:  http-client, curl
Urllib
Request HTTP(s) URLs in a complex world
Stars: ✭ 600 (+214.14%)
Mutual labels:  http-client, curl
go-axios
HTTP Request package for golang.
Stars: ✭ 29 (-84.82%)
Mutual labels:  curl, http-client
diciotto
✈️ A no-nonsense PHP Http client focused on DX (PSR 18 compliant)
Stars: ✭ 23 (-87.96%)
Mutual labels:  curl, http-client
Http Client
A high-performance, high-stability, cross-platform HTTP client.
Stars: ✭ 86 (-54.97%)
Mutual labels:  http-client, curl
Httpp
Micro http server and client written in C++
Stars: ✭ 144 (-24.61%)
Mutual labels:  http-client, curl
  • ob-http

[[http://melpa.org/#/ob-http][file:http://melpa.org/packages/ob-http-badge.svg]] [[http://stable.melpa.org/#/ob-http][file:http://stable.melpa.org/packages/ob-http-badge.svg]]

http request in org-mode babel, requires curl

: #+BEGIN_SRC http :pretty : GET https://api.github.com/repos/zweifisch/ob-http/languages : Accept: application/vnd.github.moondragon+json : #+END_SRC : : #+RESULTS: : : { : : "Emacs Lisp": 8170 : : }

** setup

To use =ob-http= in an =org-babel= source block, the http language must be enabled in the custom =org-babel-load-languages= alist. Alternatively, running the following snippet during initialization will enable the mode.

#+BEGIN_SRC emacs-lisp (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (http . t))) #+END_SRC

** options

| option | curl | example | |---------------+----------------+-----------------------------------------------------------------------------------------| | =:proxy= | =-x= | =:proxy localhost:8118= | | =:noproxy= | =--noproxy *= | N/A | | =:cookie-jar= | =--cookie-jar= | =:cookie-jar username= | | =:cookie= | =--cookie= | =:cookie username= | | =:max-time= | =--max-time= | default is =10= | | =:user= | =--user= | =:user admin:passwd= | =:pretty= | N/A | =:pretty= use =Content-Type=, to overwrite =:pretty json= | | =:select= | N/A | =:select path= path will be passed to [[https://stedolan.github.io/jq/][jq]] for json or [[https://github.com/EricChiang/pup][pup]] for html or [[http://xmlstar.sourceforge.net/][xmlstarlet]] for xml | | =:get-header= | N/A | =:get-header X-Subject-Token= | | =:curl= | N/A | =:curl --insecure --compressed= additional arguments for curl | | =:resolve= | =--resolve= | =:resolve example.com:80:127.0.0.1,example.com:443:127.0.0.1= |

** examples

**** set arbitrary header

: #+BEGIN_SRC http :pretty : GET http://httpbin.org/user-agent : User-Agent: ob-http : #+END_SRC : : #+RESULTS: : : { : : "user-agent": "ob-http" : : }

**** json

: #+BEGIN_SRC http :pretty : POST http://httpbin.org/post : Content-Type: application/json : : { : "key": "value" : } : #+END_SRC : : #+RESULTS: : #+begin_example : { : "url": "http://httpbin.org/post", : "json": { : "key": "value" : }, : "headers": { : "User-Agent": "curl/7.35.0", : "Host": "httpbin.org", : "Content-Type": "application/json", : "Content-Length": "18", : "Accept": "/" : }, : "form": {}, : "files": {}, : "data": "{ "key": "value"}", : "args": {} : } : #+end_example

**** form submit

: #+BEGIN_SRC http :pretty : PATCH http://httpbin.org/patch : : key=value&foo=value : #+END_SRC : : #+RESULTS: : #+begin_example : { : "url": "http://httpbin.org/patch", : "origin": "116.227.144.38", : "json": null, : "headers": { : "User-Agent": "curl/7.35.0", : "Host": "httpbin.org", : "Content-Type": "application/x-www-form-urlencoded", : "Content-Length": "19", : "Accept": "/" : }, : "form": { : "key": "value", : "foo": "value" : }, : "files": {}, : "data": "", : "args": {} : } : #+end_example

**** variable

: #+HEADER: :var name="ob-http" : #+HEADER: :var password="secret" : #+BEGIN_SRC http :select .json : POST http://httpbin.org/post : Content-Type: application/json : : { : "auth": { : "name": "${name}", : "password": "${password}" : } : } : #+END_SRC : : #+RESULTS: : : { : : "auth": { : : "password": "secret", : : "name": "ob-http" : : } : : }

**** use properties

supported headers:

  • pretty
  • proxy
  • noproxy
  • cookie
  • schema
  • host
  • port
  • user
  • max-time

: * api test : :PROPERTIES: : :header-args: :var token="secret" :host httpbin.org :pretty : :END: : : #+BEGIN_SRC http : POST /post : Content-Type: application/json : X-Auth-Token: ${token} : #+END_SRC : : #+RESULTS: : #+begin_example : { : "url": "http://httpbin.org/post", : "json": null, : "headers": { : "X-Auth-Token": "secret", : "User-Agent": "curl/7.35.0", : "Host": "httpbin.org", : "Content-Type": "application/json", : "Accept": "/" : }, : "form": {}, : "files": {}, : "data": "", : "args": {} : } : #+end_example

**** files

: #+BEGIN_SRC http :file zweifisch.jpeg : GET https://avatars.githubusercontent.com/u/447862?v=3 : #+END_SRC

: #+RESULTS: : [[file:zweifisch.jpeg]]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].