当前位置:
首页 > 编程开发 > Python基础教程 >
-
python基础教程之Django Rest Framework(3)
views.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
from rest_framework.views import APIView from rest_framework.response import Response class TestView(APIView): def dispatch( self , request, * args, * * kwargs): """ 请求到来之后,都要执行dispatch方法,dispatch方法根据请求方式不同触发 get/post/put等方法 注意:APIView中的dispatch方法有好多好多的功能 """ return super ().dispatch(request, * args, * * kwargs) def get( self , request, * args, * * kwargs): return Response( 'GET请求,响应内容' ) def post( self , request, * args, * * kwargs): return Response( 'POST请求,响应内容' ) def put( self , request, * args, * * kwargs): return Response( 'PUT请求,响应内容' ) |
栏目列表
最新更新
python基础(26):类的成员(字段、方法、属性
Django Rest Framework
Python进程池multiprocessing.Pool的用法
打包Python文件为exe
python发送邮件
python基础(27):类成员的修饰符、类的特殊
Python—创建进程的三种方式
Python openpyxl Excel绘制柱形图
Python学习笔记(九)
python基础-面向过程编程
.Net Standard(.Net Core)实现获取配置信息
Linux PXE + Kickstart 自动装机
Shell 编程 基础
Shell 编程 条件语句
CentOS8-网卡配置及详解
Linux中LVM逻辑卷管理
1.数码相框-相框框架分析(1)
Ubuntu armhf 版本国内源
Linux中raid磁盘阵列
搭建简易网站
mysql 安装了最新版本8.x版本后的报错:
Mysql空间数据&空间索引(spatial)
如何远程连接SQL Server数据库的图文教程
复制SqlServer数据库的方法
搜索sql语句
sql中返回参数的值
sql中生成查询的模糊匹配字符串
数据定义功能
数据操作功能
将Session值储存于SQL Server中