HTTP and Flask Basics - HTTP Requests

HTTP requests are sent from the client to the server to initiate some operation. In addition to the URL, HTTP requests have other elements to specify the requested resource.

Elements:

  • Method: Defines the operation to be performed
  • Path: The URL of the resource to be fetched, excluding the scheme and host
  • HTTP Version
  • Headers: optional information, success as Accept-Language
  • Body: optional information, usually for methods such as POST and PATCH, which contain the resource being sent to the server.

请添加图片描述
请添加图片描述

Request Methods:
Different request methods indicate different operations to be performed. It’s essential to attend to this to correctly format your requests and properly structure an API.

  • GET: ONLY retrieves information for the requested resource of the given URI. Retrieve some information from the backend.
  • POST: Send data to the server to create a new resource
  • PUT: Replaces all of the representation of the target resource with the request data
  • PATCH: Partially modifies the representation of the target resource with the request data
  • DELETE: Removes all of the representation of the resource specified by the URI
  • OPTIONS: Sends the communication options for the requested resource.

Evolution of HTTP

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值