Let's Run Jinyeah

Build REST APIs 본문

Programming/Web

Build REST APIs

jinyeah 2021. 11. 19. 19:17

Steps to build APIs


  1. identify the resources in web service
  2. define the API endpoints
  3. pick a data format in REST API
    • XML: elements, each element has an opening and closing tag
    • JSON: key-value pairs similar to a Python dictionary
  4. format your API responses to HTTP requests
    • HTTP requests
      • HTTP method, API endpoint, HTTP version, API host
    • HTTP responses 
      • Success
        • Content-Type header to define how to purse data
        • status code
      • Error
        • description of what error occured along with the appropriate status code

 


3 popular frameworks for building REST APIs in Python


  1. Flask
  2. Django
  3. FastAPI

참고

https://realpython.com/api-integration-in-python/#rest-architecture

'Programming > Web' 카테고리의 다른 글

[Python] Consuming APIs  (0) 2021.11.19
[FastAPI] Build APIs  (0) 2021.11.19
REST API  (0) 2021.11.19
[Error]CSS style 변경 후 웹브라우저에 반영이 안되는 경우  (0) 2021.01.15
웹 서버란?  (0) 2021.01.07
Comments