45 lines
881 B
Plaintext
45 lines
881 B
Plaintext
Implementing a RESTful API
|
|
==========================
|
|
|
|
It is recommended to install Flask
|
|
and Flask-RESTful, which is an extension for Flask which enables rapid development of REST API with minimal setup.
|
|
|
|
conda install -c anaconda flask
|
|
conda install -c conda-forge flask-restful
|
|
|
|
Install Insomnia as a User Tool
|
|
===============================
|
|
# Add to sources
|
|
echo "deb https://dl.bintray.com/getinsomnia/Insomnia /" \
|
|
| sudo tee -a /etc/apt/sources.list.d/insomnia.list
|
|
|
|
# Add public key used to verify code signature
|
|
wget --quiet -O - https://insomnia.rest/keys/debian-public.key.asc \
|
|
| sudo apt-key add -
|
|
|
|
# Refresh repository sources and install Insomnia
|
|
sudo apt-get update
|
|
sudo apt-get install insomnia
|
|
|
|
Using insomnia
|
|
==============
|
|
GET 127.0.0.1:5000/user/Thomas
|
|
|
|
POST 127.0.0.1:5000/user/Thomas
|
|
|
|
Multipart
|
|
age 56
|
|
occupation AI engineer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|