diff --git a/docs/server/generate_http_server_api_documentation.py b/docs/server/generate_http_server_api_documentation.py index 2d4d0fba..6cd35d90 100644 --- a/docs/server/generate_http_server_api_documentation.py +++ b/docs/server/generate_http_server_api_documentation.py @@ -66,31 +66,39 @@ Content-Type: application/json TPLS['post-tx-response'] = """\ -HTTP/1.1 201 Created +HTTP/1.1 202 Accepted Content-Type: application/json - -%(tx)s +Location: ../statuses/%(txid)s """ -TPLS['get-tx-status-request'] = """\ -GET /transactions/%(txid)s/status HTTP/1.1 +TPLS['get-statuses-tx-request'] = """\ +GET /statuses/%(txid)s HTTP/1.1 Host: example.com """ -TPLS['get-tx-status-response'] = """\ +TPLS['get-statuses-tx-invalid-response'] = """\ HTTP/1.1 200 OK Content-Type: application/json +{ + "status": "invalid" +} +""" + + +TPLS['get-statuses-tx-valid-response'] = """\ +HTTP/1.1 303 See Other +Content-Type: application/json +Location: ../transactions/%(txid)s + { "status": "valid" } """ - - def main(): """ Main function """ privkey = 'CfdqtD7sS7FgkMoGPXw55MVGGFwQLAoHYTcBhZDtF99Z' diff --git a/docs/server/source/drivers-clients/http-client-server-api.rst b/docs/server/source/drivers-clients/http-client-server-api.rst index 08e0d5e3..fca6069a 100644 --- a/docs/server/source/drivers-clients/http-client-server-api.rst +++ b/docs/server/source/drivers-clients/http-client-server-api.rst @@ -224,12 +224,17 @@ Statuses **Example request**: - .. literalinclude:: samples/get-tx-status-request.http + .. literalinclude:: samples/get-statuses-tx-request.http :language: http **Example response**: - .. literalinclude:: samples/get-tx-status-response.http + .. literalinclude:: samples/get-statuses-tx-invalid-response.http + :language: http + + **Example response**: + + .. literalinclude:: samples/get-statuses-tx-valid-response.http :language: http :resheader Content-Type: ``application/json``