@@ -5,36 +5,36 @@ layout: hooks
55
66# Testing Hooks
77
8- (TODO: are we going to continue to recommend outside services, like RequestBin?)
9-
10- ### Configuring the Server
11-
12- Now, the fun part. We'll set up a basic Sinatra server to handle incoming payloads:
13-
14- ``` ruby
15- require ' sinatra '
16- require ' rest_client '
17- require ' json '
18-
19- post ' /callback ' do
20- puts request.body.read
21- end
22- ```
23-
24-
25- ``` json
26- {
27- "payload" :{
28- "ref" : " refs/heads/master " ,
29- "after" : " 9a21d582f13c5b652c2c9546322bbf71682d3f06 " ,
30- "before" : " 05333fedb2f49ee2dd0dcc24b01d3d964f43c255 " ,
31- },
32- ...
33- "event" : " push " ,
34- "config" :{
35- "greeting_message" : " Hey, how it's going~! " ,
36- "url" : " http://4pw3.localtunnel.com/callback "
37- },
38- "guid" : " 6168aab4-4737-11e3-9ac9-7403c7a52ec3 "
39- }
40- ```
8+ * TOC
9+ { : toc }
10+
11+ Now that you've [ configured your local server ] ( /hooks/configuring/ ) , you might
12+ be interested in pushing your code to the limits. To that end, GitHub's webhooks
13+ view provides some tooling for testing your deployed payloads.
14+
15+
16+ ## Listing recent deliveries
17+
18+ Every webhook has its own "Recent Deliveries" section, which lists, at a glance
19+ whether a deployment was successful (green dot) or failed (red dot).
20+
21+ ![ Recent Deliveries view ] ( /images/webhooks_recent_deliveries.png )
22+
23+ You can also identify when each delivery was attempted.
24+
25+ ## Digging into results
26+
27+ By expanding an individual delivery, you'll be able to witness * precisely *
28+ what information GitHub is attempting to send to your server. This includes
29+ both the HTTP Request and Response.
30+
31+ ### Request
32+
33+ The webhook delivery view provides information on which Headers were sent by GitHub.
34+ It also includes details about the JSON payload.
35+
36+ ## Response
37+
38+ The response tab lists how your server replied once it received the payload from
39+ GitHub. This includes the status code, the headers, and any additional data
40+ within the response body.
0 commit comments