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: slate/source/index.md
+27-29Lines changed: 27 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -43,29 +43,27 @@ A similar pattern of HTTP response codes applies to other endpoints such us `/bu
43
43
44
44
To use API V2.1 set the `Accept` header of your API request to `application/vnd.travis-ci.2.1+json`.
45
45
46
-
> Note that the rest of the examples in this document have the `Accept` header set to API V2.
47
-
48
46
# Making Requests
49
47
50
48
```http
51
49
GET / HTTP/1.1
52
50
User-Agent: MyClient/1.0.0
53
-
Accept: application/vnd.travis-ci.2+json
51
+
Accept: application/vnd.travis-ci.2.1+json
54
52
Host: api.travis-ci.org
55
53
```
56
54
57
55
```http
58
56
GET / HTTP/1.1
59
57
User-Agent: MyClient/1.0.0
60
-
Accept: application/vnd.travis-ci.2+json
58
+
Accept: application/vnd.travis-ci.2.1+json
61
59
Authorization: token "YOUR TRAVIS ACCESS TOKEN"
62
60
Host: api.travis-ci.com
63
61
```
64
62
65
63
```http
66
64
GET /api HTTP/1.1
67
65
User-Agent: MyClient/1.0.0
68
-
Accept: application/vnd.travis-ci.2+json
66
+
Accept: application/vnd.travis-ci.2.1+json
69
67
Authorization: token "YOUR TRAVIS ACCESS TOKEN"
70
68
Host: travis.example.com
71
69
```
@@ -120,7 +118,7 @@ The first thing you need to know is what API URL endpoint to use:
120
118
When you write your own Travis CI client, please keep the following in mind:
121
119
122
120
- Always set the **User-Agent** header. This header is not required right now, but will be in the near future. Assuming your client is called "My Client", and its current version is 1.0.0, a good value would be `MyClient/1.0.0`. For our command line client running on OS X 10.9 on Ruby 2.1.1, it might look like this: `Travis/1.6.8 (Mac OS X 10.9.2 like Darwin; Ruby 2.1.1; RubyGems 2.0.14) Faraday/0.8.9 Typhoeus/0.6.7`.
123
-
- Always set the **Accept** header to `application/vnd.travis-ci.2+json` to make sure that you get results from the V2 API. See also the note about [API V2.1](#API-V2.1)
121
+
- Always set the **Accept** header to `application/vnd.travis-ci.2.1+json` to make sure that you get results from the V2.1 API. See also the note about [API V2.1](#API-V2.1)
124
122
125
123
Client libraries will usually set these headers automatically.
126
124
@@ -129,7 +127,7 @@ Client libraries will usually set these headers automatically.
129
127
```http
130
128
GET /config HTTP/1.1
131
129
User-Agent: MyClient/1.0.0
132
-
Accept: application/vnd.travis-ci.2+json
130
+
Accept: application/vnd.travis-ci.2.1+json
133
131
Host: api.travis-ci.org
134
132
```
135
133
@@ -198,7 +196,7 @@ This includes, amongst other things:
198
196
```http
199
197
GET /users HTTP/1.1
200
198
User-Agent: MyClient/1.0.0
201
-
Accept: application/vnd.travis-ci.2+json
199
+
Accept: application/vnd.travis-ci.2.1+json
202
200
Host: api.travis-ci.org
203
201
Authorization: token "YOUR TRAVIS ACCESS TOKEN"
204
202
```
@@ -232,7 +230,7 @@ You can retrieve a token by using a GitHub token to prove who you are. In the fu
0 commit comments