HTTP & AJAX06.HTTP & AJAX 19 décembre 2023 Développement web il3 HTTP & AJAX HE-Arc (DGR) 2022 HyperText Transfer Protocol • Protocole application : invention www en 1990 (v0.9) – Connexion, GET, réponse, fermeture • HTTP 1.0 (1996) – Entêtes de requête (Host, Referer, User-Agent, …) et réponse (Content-Type, Set- Cookie, Location, …) • HTTP 1.1 (1997) – Nouveaux entêtes (Keep-alive, pipelining, cache Host obligatoire • HTTP 2.01 (2015) – Binaire, multiplexage connexions, compression entêtes, push, … – Supporté par presque tous2 les navigateurs, une majorité de serveurs • HTTP 3.03 (2019) – UDP,0 码力 | 11 页 | 91.09 KB | 1 年前3
08 Cookie, Session与HTTP请求 杨亮 《PHP语⾔程序设计》Cookie, Session 与HTTP请求 杨亮 Web基本流程 PC Mobile 服务器 (Apache) (IIS) 后端脚本 (PHP) (JSP) (ASP) 数据库 (MySQL) (Oracle) (Access) HTTP 请求 对应⽂文件 获取数据 返回数据 返回⻚页⾯面 返回⻚页⾯面 请求⻚页⾯面 服务器端 客户端 html css 如果⼀一家咖啡店,买五杯送⼀一杯 信息存在哪⾥里? 超⽂文本传输协议 HTTP HyperText Transfer Protocol ⽆无状态 Cookie Session 头部 内容 (html) Cookie 保存在浏览器端的⽤用户数据,⽤用以进⾏行会话控制 浏览器端脚本(JavaScript)设定Cookie 服务器端程序(PHP)通过HTTP请求命令浏览器设定Cookie 浏览器向服务器发送请求时会附加上相应的Cookie value1 name2 value2 name3 value3 name4 value4 五⼤大要素:名字、值、域、路径、过期时间 $_COOKIE[name] 所有Cookie都是放到http头信息中 服务器 PHP 浏览器 Cookie Set-Cookie:user=stefyang Cookie:user=stefyang time() 当前时间 time()+60*600 码力 | 12 页 | 1.30 MB | 1 年前3
CakePHP Cookbook 2.x
data Exceptions Exception configuration Exception classes Built-in Exceptions for CakePHP Using HTTP exceptions in your controllers Exception Renderer Creating your own application exceptions Extending form of /controller/action/param1/param2. At this point, you should be able to point your browser to http://www.example.com/posts/index. You should see your view, correctly formatted with the title and table use it. If necessary, include it in your AppController. Here’s what the add() action does: if the HTTP method of the request was POST, it tries to save the data using the Post model. If for some reason0 码力 | 1096 页 | 958.62 KB | 1 年前3
CakePHP Cookbook Documentation 5.xDependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 Mocking HTTP Client Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749 vi 34 Http Client 765 Doing Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reading 5 CakePHP Cookbook Documentation, Release 5.x The IRC Channel IRC Channels on irc.freenode.net: • #cakephp – General Discussion • #cakephp-docs – Documentation • #cakephp-bakery – Bakery • #cakephp-fr0 码力 | 848 页 | 2.53 MB | 1 年前3
CakePHP Cookbook Documentation 5.xPrefix Routes Plugin Routing Creating Links to Plugin Routes SEO-Friendly Routing Matching Specific HTTP Methods Matching Specific Hostnames Routing File Extensions Route Scoped Middleware Grouping Middleware Request Conditions Session Data Host and Domain Name Reading the HTTP Method Restricting Which HTTP method an Action Accepts Reading HTTP Headers Trusting Proxy Headers Checking Accept Headers Reading Cookies Setting Headers Setting the Body Setting the Character Set Interacting with Browser Caching Fine Tuning HTTP Cache Setting Cookies Setting Cross Origin Request Headers (CORS) Common Mistakes with Immutable0 码力 | 1080 页 | 939.39 KB | 1 年前3
CakePHP Cookbook 2.x
user directory that already uses mod_rewrite. If you are installing CakePHP into a user directory (http://example.com/~username/ cakephp/), or any other URL structure that already utilizes mod_rewrite, PHP running as a FastCGI instance. server { listen 80; server_name www.example.com; rewrite ^(.*) http://example.com$1 permanent; } server { listen 80; server_name example.com; # root directive should (continues on next page) 6 https://www.microsoft.com/web/downloads/platform.aspx 7 https://www.iis.net/downloads/microsoft/url-rewrite 8 https://www.microsoft.com/en-us/download/details.aspx?id=5747 9 https://www0 码力 | 820 页 | 2.52 MB | 1 年前3
CakePHP Cookbook 3.x
Prefix Routes Plugin Routing Creating Links to Plugin Routes SEO-Friendly Routing Matching Specific HTTP Methods Matching Specific Hostnames Routing File Extensions Connecting Scoped Middleware Grouping Request Conditions Session Data Host and Domain Name Reading the HTTP Method Restricting Which HTTP method an Action Accepts Reading HTTP Headers Trusting Proxy Headers Checking Accept Headers Cookies Setting Headers Setting the Body Setting the Character Set Interacting with Browser Caching Fine Tuning HTTP Cache Setting Cookies Setting Cross Origin Request Headers (CORS) Common Mistakes with Immutable0 码力 | 1244 页 | 1.05 MB | 1 年前3
CakePHP Cookbook 3.x
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871 34 Http Client 887 Doing Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reading 5 CakePHP Cookbook Documentation, Release 3.10 The IRC Channel IRC Channels on irc.freenode.net: • #cakephp – General Discussion • #cakephp-docs – Documentation • #cakephp-bakery – Bakery • #cakephp-fr example, UsersController (which would be defined in the file name UsersController.php) is accessed from http://example.com/users. While you can route multiple word controllers in any way you like, the convention0 码力 | 967 页 | 2.80 MB | 1 年前3
Guzzle PHP 6.5 Documentationindex next | Guzzle 6 » Guzzle Documentation Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Simple interface for building query strings strings, POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading JSON data, etc... Can send both synchronous and asynchronous requests using the same interface. Uses allows you to utilize other PSR-7 compatible libraries with Guzzle. Abstracts away the underlying HTTP transport, allowing you to write environment and transport agnostic code; i.e., no hard dependency0 码力 | 65 页 | 311.42 KB | 11 月前3
Guzzle PHP 7.0 Documentationindex next | Guzzle 6 » Guzzle Documentation Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Simple interface for building query strings strings, POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading JSON data, etc... Can send both synchronous and asynchronous requests using the same interface. Uses allows you to utilize other PSR-7 compatible libraries with Guzzle. Abstracts away the underlying HTTP transport, allowing you to write environment and transport agnostic code; i.e., no hard dependency0 码力 | 64 页 | 310.93 KB | 11 月前3
共 95 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













