-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.http
94 lines (77 loc) · 2.34 KB
/
example.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# -*- http -*-
## Setup:
# 1. Install http.el
# 2. Set `http-mode` as major mode.
## Usage:
# Move the cursor somewhere within the description of the http request and
# execute `M-x http-process` or press `C-c C-c`, if everything is went
# well should show an buffer when the response of the http request.
GET https://httpbin.org/ip
GET https://httpbin.org/xml
# Text
GET http://www.ietf.org/rfc/rfc4627.txt
# Encoding
GET https://httpbin.org/encoding/utf8
GET https://www.google.de/
# Images
GET https://httpbin.org/image/png
GET https://httpbin.org/image/svg
# Redirects
GET https://httpbin.org/redirect/3
## Sending headers:
POST https://httpbin.org/post?foo=bar
User-Agent: Emacs24
## Sending data:
# To send the data in the body of the request it's necessary to separate of the
# headers by a new line.
POST https://httpbin.org/post?val=key
User-Agent: Emacs24
Content-Type: application/json
{
"foo": "bar"
}
# You can press "C-'" in a request to edit the body in a indirect buffer with a
# mode based in the request content-type header.
## Extra Examples:
# Creating a gist:
# https://developer.github.com/v3/gists/#create-a-gist
POST https://api.github.com/gists
Accept: application/vnd.github.v3+json
User-Agent: Emacs24
Content-Type: application/json
{
"description": "test",
"public": false,
"files": {
"file1.txt": {
"content": "Created with http.el"
}
}
}
# Indexing a document to Elasticsearch
PUT http://localhost:9200/megacorp/employee/1?pretty
Content-Type: application/json
{
"first_name": "John",
"last_name": "Smith",
"age": 25,
"about": "I love to go rock climbing",
"interests": [
"sports",
"music"
]
}
# Elasticsearch Bulk Indexing
# https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
POST http://localhost:9200/_bulk?pretty
{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
{ "create" : { "_index" : "test", "_type" : "type1", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_type" : "type1", "_index" : "index1", "_retry_on_conflict": 3} }
{ "doc" : {"field2" : "value2"} }
# Elasticsearch cat apis
# https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html
GET http://localhost:9200/_cat/indices?v
GET http://localhost:9200/_cat/health?v