Skip to content

kayashaolu/webarch-lab-9

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Lab 9

Create your own API

In this lab you will accomplish the following

  • Create an API using Python and Flask
  • Create a GET and a POST endpoint
  • Use curl to interact with your API

Create an API that allows to retrieve and set an integer

  • In your back end API, create a variable called current_value and set it to 0;
  • Create a GET request with path "/value" that returns the current_value variable via JSON
  • There are no inputs for this GET request
  • The output of this GET request should be the count in JSON:
{
  "current_value": 7
}
  • Create a POST request with path "/value" that sets the current_value variable via JSON
  • There is a single input called "current_value" that must be sent via JSON
{
  "current_value": 10
}
  • There is a single output saying that the command was successful using JSON
{
  "message": "The command was successful"
}

About

Create your own API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published