You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+70-12Lines changed: 70 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,17 +3,22 @@ aurl
3
3
4
4
## Description
5
5
6
-
HTTP CLI client with OAuth2 authentication
6
+
HTTP CLI client with OAuth 2.0 authentication.
7
7
8
-
curl is powerful command line tool and you can make any complex HTTP request to every servers. But the target web
9
-
server is secured by OAuth2, you must request another HTTP request to the authorization server before making
10
-
principal request. And more, you should to manage issued access tokens for every resources.
8
+
You know `curl` is powerful command line tool and you can make any complex HTTP request to every servers. But the target web server is secured by OAuth 2.0, you must send another HTTP request to the authorization server before making principal request. And more, you should to manage issued access tokens for every resources.
11
9
12
-
aurl is auto processing OAuth dance and manage access/refresh tokens.
10
+
`aurl` is a command-line tool that process OAuth 2.0 dance and manage access/refresh tokens automatically.
11
+
12
+
**Note:** Currently, `aurl` is not support OAuth 1.0a. Your pull-request is appreciated.
13
13
14
14
## Install
15
15
16
-
To install, use `go get`:
16
+
To install, use `homebrew` or `go get`:
17
+
18
+
```bash
19
+
$ brew tap classmethod-aws/cm
20
+
$ brew install aurl
21
+
```
17
22
18
23
```bash
19
24
$ go get -d github.com/classmethod-aws/aurl
@@ -23,10 +28,29 @@ $ go get -d github.com/classmethod-aws/aurl
23
28
24
29
### Profile configuration
25
30
26
-
First, you MUST create profile setting file `~/.aurl/profiles` file which format is described below.
31
+
First, you must create profile setting file `~/.aurl/profiles` file which format is described below.
27
32
Profile setting file format is typically called [INI file](http://en.wikipedia.org/wiki/INI_file).
28
33
Each section name is used as profile name.
29
34
35
+
###### SYNOPSIS
36
+
37
+
Section name is utilized as profile name. In each section following key settings are available:
38
+
39
+
| key name | description | default value | available values | mandatory |
`command` is every http method (e.g. `get`, `post`, `delete`) and first argument is target url.
122
+
`command` is every http method (e.g. `get`, `post`, `delete`) and first argument is target url. You can see all `command` in the help message. Try, `aurl -h`.
73
123
74
124
###### EXAMPLE
75
125
76
126
```bash
77
127
$ aurl get http://api.example.com/path/to/resource
128
+
...http.response.body...
78
129
$ aurl post http://api.example.com/path/to/resource --data "foobar"
130
+
...http.response.body...
79
131
```
80
132
81
133
aurl make request with access token in `Authorization` header of `default` profile.
82
134
You can specify profile name with `--profile` option.
83
135
84
136
```bash
85
-
$ aurl --profile foobar get http://api.example.com/path/to/resource
137
+
$ aurl --profile fb get https://graph.facebook.com/me
138
+
{"id":"...","email": ... }
139
+
$ aurl --profile google get https://www.googleapis.com/plus/v1/people/me
140
+
{
141
+
"kind": "plus#person",
142
+
...
143
+
}
86
144
```
87
145
88
146
By default aurl prints response body in stdout. When an error occured the detail is printed in stderr.
89
147
You may want not response body but response header, then you can use `--no-body` and `--print-headers` option.
0 commit comments