Week 2 of the DevNet Grind – Building REST APIs in Python to GET / POST / PUT / DELETE / verify Auth Hands on Lab!

rest1

This is an item I will likely have to circle back around to so want screen snips

REST API created via Python to GET Books from a Library

rest2

rest3

REST API created via Python to POST books to a Library

rest5

rest6

When run this simply sends back a 200 OK HTTP Status Code as a response.

rest7

Hope that is readable, that is another way to write the same request using urllib package that comes standard in the Pythin Library, and also returns a 200 OK.

REST APIs created via Python to PUT / Update Books in a Library

rest8

rest9

Not sure if I can run that all in one API Call, lets check it out here:

rest11

A 2xx response looks good to me! Moving right along.

REST APIs created via Python to DELETE books from a Library

rest22

rest44rest33

I’ll spare the output but got a 204 OK Status back.

REST APIs using Python to create them with Authentication built in!

rest55

rest66

I didn’t grab a screen shot but this did come back with a 200 OK Status, so this script should be a good foundation to build off of for a REST API via Python.

That is it for this weeks Hands On lab, thankfully only the one Lab to catch up on

I thought there was some remote API Authentication Python test scripts you can run, but I am not seeing them, but I’ll keep an eye out and will be labbing these and many more topics here once I cover the theory and catch up on my Python!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s