-
Notifications
You must be signed in to change notification settings - Fork 2
REST API
Roman Parashchenko edited this page Feb 24, 2014
·
1 revision
The REST API of the web service is described below.
GET /page_classes
curl -i -H 'Accept: application/json' http://localhost:7000/page_classes
HTTP/1.1 200 OK
Date: Sat, 04 Jan 2014 15:13:14 GMT
Status: 200 OK
Connection: close
Content-Type: application/json;charset=utf-8
Content-Length: 12
X-Content-Type-Options: nosniff
["TestPage"]
GET /page_classes?url=<current page url>&title=<current page title>
curl -i -H 'Accept: application/json' http://localhost:7000/page_classes?url=http://test.com&title=Welcome%20to%20Test%20Site
HTTP/1.1 200 OK
Date: Sat, 04 Jan 2014 15:20:49 GMT
Status: 200 OK
Connection: close
Content-Type: application/json;charset=utf-8
Content-Length: 19
X-Content-Type-Options: nosniff
{"page":"TestPage"}
GET /pages/:page_class
curl -i -H 'Accept: application/json' http://localhost:7000/pages/TestPage
HTTP/1.1 200 OK
Date: Sat, 04 Jan 2014 14:06:19 GMT
Status: 200 OK
Connection: close
Content-Type: application/json;charset=utf-8
Content-Length: 215
X-Content-Type-Options: nosniff
[{"feature":{"name":"...","description":"...","path_to_file":"...","line":1},"scenarios":[{"scenario":{"name":"...","line":10},"steps":[{"text":"...","line":11,"used":"yes"},{"text":"...","line":12,"used":"no"}]}]}]
GET /pages/:page_class
curl -i -H 'Accept: application/json' http://localhost:7000/pages/UnknownPage
HTTP/1.1 404 Not Found
Date: Sat, 04 Jan 2014 13:50:09 GMT
Status: 404 Not Found
Connection: close
Content-Type: application/json;charset=utf-8
Content-Length: 58
X-Content-Type-Options: nosniff
{"status":404,"reason":"Page 'UnknownPage' was not found"}