Skip to content
Roman Parashchenko edited this page Feb 24, 2014 · 1 revision

The REST API of the web service is described below.

Get all Page Classes

Request

GET /page_classes

curl -i -H 'Accept: application/json' http://localhost:7000/page_classes

Response

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 Class by title and url

Request

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

Response

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 statistic for specific Page Class

Request

GET /pages/:page_class

curl -i -H 'Accept: application/json' http://localhost:7000/pages/TestPage

Response

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 statistic for a non-existent Page Class

Request

GET /pages/:page_class

curl -i -H 'Accept: application/json' http://localhost:7000/pages/UnknownPage

Response

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"}

Clone this wiki locally