http://www.cnblogs.com/wupeiqi/articles/5341480.html

请求方式8种:

1.GET:请求指定页面信息,并返回实体

2.POST:向指定资源提交数据进行处理,数据被包含在请求体中,POST请求可能会导致新资源的创建或者对已有资源的修改。

3.PUT:向指定资源位置上传其最新内容

4.DELETE:请求服务器删除指定的页面(URL)

5.OPTIONS:允许客户端查看服务器的性能,可以利用向web服务器发送'*'的请求来测试服务器的性能

6.TRACE:回显服务器收到的请求,主要用于测试或者诊断

7.HEAD:向服务器索要与GET请求相一致的响应,只不过相应体不会被返回,这一方法可以在不必传输整个相应内容的情况下,

就可以获取包含在响应消息头中的元信息。

8.CONNECT:HTTP/1.1协议中预留给能够将连接改为管道方式的代理服务器

bottle:

request:

headers:请求头信息

query:  get请求信息

forms:  post请求信息

files: 上传文件信息

params:  get和post请求信息

GET: get请求信息

POST: post请求信息

cookies: cookie信息

environ: 环境相关信息

response:

status_line:状态行

status_code:状态码

headers:响应头

charset: 字符编码

set_cookie:在浏览器上设置cookie

app01.run(host='localhost', port=8080, server='wsgiref') #可以指定WEB服务,默认是wsgiref

flask:

路由系统:

@app.route('/user/<username>')

@app.route('/user/<int:post_id>')

@app.route('/user/<float:post_id>')

@app.route('/user/<path:path>')

@app.route('/login',methods=['GET','POST'])

默认不支持直接正则表达式的路由,可以通过自定义来实现

DEFAULT_CONVERTERS = {

'default':          UnicodeConverter,

'string':           UnicodeConverter,

'any':              AnyConverter,

'path':             PathConverter,

'int':              IntegerConverter,

'float':            FloatConverter,

'uuid':             UUIDConverter,

}

模板:Flask 使用的是JINJA2模板,和Django几乎无差别

自定义函数,

eg:

from flask import Flask,render_remplate

app = Flask(__name__)

def func():

return '<h1>This is Func!</h1>'

@app.route('/login',methods=['GET','POST'])

def login():

return render_template('login.html',ff=func)

app.run()

htm:

<body>

{{ff()|safe}}

</body>

request:

methods

args

form

values

files

cookies

headers

path

full_path

script_root

url

base_url

url_root

host_url

host

Session:

设置:session['username'] = 'mihon'

删除:session.pop('username', None)

message:

是基于Session实现的用于保存数据的集合,特点:使用一次就删除

Tornado:

非阻塞式服务器,速度快,得力于非阻塞的方式和对epoll的运用

WEBs的更多相关文章

  1. you need to know those webs !

    J2me开发网 http://www.j2medev.com/bbs/index.asp J2me社区 http://www.j2meforums.com/forum/ csdn http://www ...

  2. python scraping webs - python取得NIPS oral paper列表

    from lxml import html import requests # using xpath # page = requests.get('http://econpy.pythonanywh ...

  3. SQL通过ContentTypeID找使用了内容类型的列表库

    DECLARE) SET @ContentTypeID='0x1B452DB25E92A34DA3E35FC8731278D2' SELECT w.Title AS [Web Site], w.Ful ...

  4. C# Mvc异常处理过滤器

    using System; using System.Text; using EMS.Domains.Core; using System.Web.Mvc; using Json.Net; using ...

  5. 执行jar文件生成pdf报错,Unsupported URL <file:///home

    java -Djava.library.path=/usr/local/lib/ruby/gems/1.8/gems/sharp_office-1.0.1/ext/sigar -jar /usr/lo ...

  6. 4、ASP.NET MVC入门到精通——NHibernate构建一个ASP.NET MVC应用程序

    下周就去办理离职手续了,之前没有使用过NHibernate,只知道NHibernate是一种ORM框架,但是听说新公司是使用NHibernate在做项目,所以,我就网上找资料学习一下NHibernat ...

  7. 24、ASP.NET MVC入门到精通——数据库仓储

    本系列目录:ASP.NET MVC4入门到精通系列目录汇总 业务层调用数据层对象,我不想每次都new一个数据层对象,而是在数据层创建一个仓储,统一管理所有的对象调用. 1.在IDAL项目中,新建IDB ...

  8. How to Operate SharePoint User Alerts with PowerShell

    When you migrate list or site, the user alerts in the site will not be migrated together with the co ...

  9. Sharepoint学习笔记—习题系列--70-573习题解析 -(Q147-Q150)

    Question 147You have a Web application named WebApp1.You have a Feature receiver named FeatureReceiv ...

随机推荐

  1. Mysql数据库操作语句总结(二)

    Mysql字符串字段判断是否包含字符串的3中方法 方法一: select * from user where email like "%b@email.com%";// 这个理解起 ...

  2. 线程池模块thernd

    from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor import time def task(i): print ...

  3. No module named 'revoscalepy'问题解决

    SqlServer2017开始支持Python,前段时间体验了下,按照微软的入门例子操作的:https://microsoft.github.io/sql-ml-tutorials/python/re ...

  4. 博客系统-后台页面搭建:eazy

    业务分析:布局为四个模块上边是系统描述,左边是导航菜单,中间是每个窗口的内容,下边是版权信息 点击左边的导航按钮,在右边窗口显示 代码: <%@ page language="java ...

  5. 第七章 动态创建HTML内容

    javascript也可以改变网页的结构和内容 document.write()方法 可以方便快捷地把字符串插入到文档里 document.write("<strong>hell ...

  6. 1.redis 安装

    1.https://redis.io/download. 2. $ wget http://download.redis.io/releases/redis-3.2.9.tar.gz $ .tar.g ...

  7. 高性能可扩展MySQL数据库设计及架构优化 电商项目(慕课)第3章 MySQL执行计划(explain)分析

    ID:相同就从上而下,不同数字越大越优先

  8. JQuery模拟点击页面上的所有a标签,触发onclick事件

    注意: 这种方法需要给所有的a标签加上id属性 页面加载完成模拟点击所有的a标签: <script> $(function () { // 模拟点击页面上的所有a标签,触发onclick事 ...

  9. IATHook

    IATHookClass.h #pragma once #include <Windows.h> class IATHookClass { private: DWORD oldAddr; ...

  10. springboot中加入druid对sql进行监控

    springboot作为现在十分流行的框架,简化Spring应用的初始搭建以及开发过程,现在我们就使用springboot来进行简单的web项目搭建并对项目sql进行监控. 项目的搭建就省略了,spr ...