Create your own API
- Create an API using Python and Flask
- Create a GET and a POST endpoint
- Use curl to interact with your API
- 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"
}