我可以在curl连接上创建多个请求吗? [英] Can I make more then one request on a curl connection?

查看:56
本文介绍了我可以在curl连接上创建多个请求吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PHP(v5)中,有没有办法在打开的curl连接上发出多个请求?



我注意到我的大瓶颈是超时/连接的断开它的自我(我正在做很多小数据请求,很快完成),所以我想能够做一些像打开



init curl连接,



设置url / params,请求,获取结果
设置url / params,请求,获取结果



关闭curl



我不知道这是否可能。

解决方案

可能是 curl_multi _ * 函数是您要查找的。

In PHP (v5), is there a way to make multiple requests on an open curl connection?

I'm noticing that my big bottleneck is the timeout/teardown of the connection its self (i'm making lots of small data requests that finish quickly), so I would like to be able to do something like open

init curl connection,

set url/params, do request, get results set url/params, do request, get results

close curl

I just dont know if this is possible at all.

解决方案

Probably the curl_multi_* functions are what you are looking for.

这篇关于我可以在curl连接上创建多个请求吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆