examples -> samples POST /transaction and /statuses

This commit is contained in:
diminator
2016-12-28 17:55:26 +01:00
committed by tim
parent 35a7d11fb3
commit 5c10602754
2 changed files with 23 additions and 10 deletions

View File

@@ -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'