Skip to content

Latest commit

 

History

History
85 lines (75 loc) · 1.83 KB

sample.org

File metadata and controls

85 lines (75 loc) · 1.83 KB

Custom function for later

(defun my-body ()
  "return plain text body"
  "some body")

POST with body

POST https://httpbin.org/post

  • Accept: application/json
  • Content-Type: application/json
{
  "data": {
    "title": "Hello",
    "hello": "world"
  }
}

No body

GET https://httpbin.org/get

Bad delete

DELETE https://httpbin.org/status/400

Embedded lisp variable

GET https://httpbin.org/status/`my-http-status`

More than one embedded lisp variable

GET `base-url`/status/`my-http-status`

Embedded lisp function

PUT https://httpbin.org/put

body=`(my-body)`

Request with callbacks

POST https://httpbin.org/post

{
  "some": "body"
}
  1. First callback
    (lambda (status headers body)
      (message "status %s, headers %s, body %s" status headers body))
        
  2. Second callback
    (lambda (status headers body)
      (pp (assoc 'url (json-read-from-string body))))
        

Multi part

POST https://httpbin.org/post

  • Accept: application/json
  • type: document
  • file: /home/username/sample_document.jpg

Request Title

GET/POST/PUT/… URL

  • Header1: value
  • Header2: value
{
  "body": "in any mode/format"
}
  1. First Callback
    (lambda (status headers body)
      (message "status %s, headers %s, body %s" status headers body))
        
  2. Second Callback
    (lambda (status headers body)
      (message "Second callback"))