zttp – ä¸ä¸ªåºäº guzzle http çæ´å¥½ç¨ç php http package_php_web-itnose
é¦é¡µ
asp
php
javascript
iis
apache
html/css
coldfusion
ajax
vbscript
cgi
xml/xsl
è·¨æµè§å¨å¼å
ruby/rails
ç¨åºå
html5
jquery
seo
jboss
json
angularjs
markdown
nginx
thinkphp
yii
pageadmin
extjs
wampserver
kendo ui
coffeescript
gulp
ecmascript
bootstrap
itnoseé¦é¡µ > web > php >
zttp – ä¸ä¸ªåºäº guzzle http çæ´å¥½ç¨ç php http package
2017-06-06 13:04
å¨ php ç项ç®ä¸ï¼å¦æä½ éè¦éè¿ä»£ç æ¥åèµ· http 请æ±ï¼æ ¹æ®åéphpæ´ççææ°æç« ï¼ç¸ä¿¡å¾å¤äººå¯¹
guzzlehttp è¿ä¸ª package å¾çæï¼ç¶èå
¶å®å¨ä½¿ç¨ guzzle çæ¶åï¼æ们ä¾ç¶å¯ä»¥åå¾æ´ç®ä¾¿ä¸ç¹çï¼æ¯å¦æ们å¯ä»¥ä½¿ç¨ zttpï¼è¿æ¯åºäº guzzle çå¦å¤ä¸ä¸ª http packageã
大è´æ¥çç zttp çç¨æ³ï¼
1.æ¯å¦åéä¸ä¸ªæºå¸¦ headers ç post 请æ±ï¼
response=zttp::withheaders([â²fancyâ²=>â²pantsâ²])â>post( url,
[
‘foo’ => ‘bar’,
‘baz’ => ‘qux’,
]);
$response->json();
å¦æä½ ä½¿ç¨ guzzle çè¯ï¼ä»£ç å¯è½åä¸é¢è¿æ ·ï¼
$client = new client();
response= client->request(âpostâ,
$url, [
‘headers’ => [
‘fancy’ => ‘pants’,
],
‘form_params’ => [
‘foo’ => ‘bar’,
‘baz’ => ‘qux’,
]
]);
json_decode($response->getbody());
æ以è¿æ ·æ¯è¾èµ·æ¥ï¼æè§å¾ zttp è¿æ¯æ¹ä¾¿ï¼nice and clean!
2.æºå¸¦ form 表ååæ°ç post 请æ±ï¼
response=zttp::asformparams()â>post( url,
[
‘foo’ => ‘bar’,
‘baz’ => ‘qux’,
]);
3.åèµ· patch 请æ±ï¼
response=zttp::patch( this->url(â/patchâ),
[
‘foo’ => ‘bar’,
‘baz’ => ‘qux’,
]);
4.åèµ· put 请æ±ï¼
response=zttp::put( this->url(â/putâ),
[
‘foo’ => ‘bar’,
‘baz’ => ‘qux’,
]);
~~~
5.åèµ· delete 请æ±ï¼
response=zttp::delete( this->url(â/deleteâ),
[
‘foo’ => ‘bar’,
‘baz’ => ‘qux’,
]);
~
6.æ·»å ä¸ä¸ªå¯æ¥åç headerï¼
~
response=zttp::accept(â²banana/sandwichâ²)â>post( url);
7.é»æ¢éå®åï¼
response=zttp::withoutredirecting()â>get( url);
ä½ å¯ä»¥çå°ï¼ä¸é¢çè¿äºäºä¾ä»£ç å
¶å®å¯ä»¥å
å«äºå¤§é¨åçåºç¨åºæ¯ï¼å¦æè¯´ä½ è¿éè¦æ´å¤æç使ç¨æ¹å¼ï¼ä½ å¯ä»¥å° github kitetail/zttp æ¥çï¼èä¸ï¼å³ä½¿ä½ è¿æ³ä½¿ç¨ guzzleï¼ä½ ä¾ç¶æ¯å¯ä»¥ä½¿ç¨ guzzle çï¼æ以æå¯ä»¥è´è´£ä»»å°å大家æ¨èä¸ä¸è¿ä¸ª zttp ç package.
æ´å¤phpç¸å
³ææ¯è¯·æç´¢åéphpï¼åçå®çèªå·±ï¼ç¨è¯å¿åæè²ã
äºèç½+æ¶ä»£ï¼æ¶å»è¦ä¿æå¦ä¹ ï¼æºæåéphp,dream
it possibleã
ç¸å
³æç´¢ï¼
åºäºxmlççµååå¡
webservice åhttp
java http webservice
java webservice http
delphi http post
ç¸å ³æç«
2016-01-07 17:53 phpå®ç°åºäºswooleç®åçhttpæå¡å¨
2016-12-27 21:52 èªå·±å¨æç¨phpç¼åä¸ä¸ªç®åçhttp server(åè¿ç¨ç)
2015-11-23 13:31 phpçhttp解ææ©å±ï¼php_http_parser
2014-03-01 01:50 phpä¸ä¼ 大æ件ç¨httpè¿æ¯tcp/ipåè®®æ´å¥½
2016-09-04 12:22 php使ç¨socketåéhttp请æ±çæ¹æ³
æ´å¤ç¸å ³æç« >>
ææ°æç«
2017-06-20 01:35 èé们ï¼æ没æå¯è½è®©phpæ件åæ¶åªè½ä¸ä¸ªäººè®¿é®
2017-06-20 01:35 æä¹ç¦æ¢å¾çç´æ¥éè¿url访é®
2017-06-20 01:35 æ±æ!å¯å¨wampåªè½ç¨æ¬æºè®¿é®,åå±åç½çå
¶å®è®¾å¤è®¿é®ä¸å°!æäºå¤§å天t-t
2017-06-19 15:35 nginxä¸çthinkphpé®é¢
2017-06-19 15:35 php form æ件ä¸ä¼
æ´å¤ææ°æç« >>
çé¨æç´¢
delphi http server
jsp includeçç¨æ³
æ¯æjspç空é´
jspä¸ç注é
å¦ä¹ .netçç½ç«
.netçç¹ç¹
å¦ä¹ javaçåºç¡
javaåºç¡çé¢ç®
javaçå¦ä¹
hibernateçä¼ç¼ºç¹
hibernateçsession
springçaop
spring mvcç注解
springçioc
webserviceçè°ç¨
京icpå¤14022385å·-2
©2014 itnose软件ç¼ç¨æç¨ | èç³»æ们ï¼emailï¼twobrushes@126.com qq:35155868