Creating an entry document in the entrylog collection

We're going to create entry documents in an entrylog collection in the database. An HTTP POST request is used to create new items. The response of 201 Created will indicate that the database created the new event.

To use the orchestrate.io database service, each request has a base URL. We can define this with a string like this:

    service = "https://api.orchestrate.io" 

The https scheme is used so that the Secure Socket Layer (SSL) is used to assure that the data is private between client and server. The host name is api.orchestrate.io. Each request will have a URL based on this base service definition.

The HTTP headers for each request will look like this:

 headers = { 'Accept': 'application/json', ...

Get Modern Python Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.