简体   繁体   English

如何使用cookie发送GET请求并且不使用PHP等待响应

[英]How to send a GET request with cookies and do not wait for response using PHP

I want to send some info to a server using cookie for authentication: 我想使用cookie进行身份验证将某些信息发送到服务器:

http://exampleserver.com/get?parm1=val1&parm2=val2&parm3=val3 

with

cookie1=asd123;cookie2=enc%19

I want only to send the request and do not wait for the response. 我只想发送请求,不等待响应。 I only need server to register the data, as depending on amount of the data sent, tge wait for the response from client side could become too high, and so I want it to be fast. 我只需要服务器注册数据,因为根据发送的数据量,tge等待来自客户端的响应可能会变得过高,因此我希望它能更快。

I know PHP is blocking, but is is possible to do this in some way? 我知道PHP会阻塞,但是可以通过某种方式做到这一点吗?

I think that what you want to obtain is like an asynchronous call to the server, which in PHP can be done using "threading", the quotes are here because is not properly threading what is possible in PHP, but almost. 我认为您想要获得的就像是对服务器的异步调用,这可以在PHP中使用“线程”完成,引号在这里是因为未正确地线程化PHP中可能发生的事情,但是几乎没有。

You can find here the answer to your question PHP threading call to a php function asynchronously 您可以在此处找到问题的答案PHP线程异步调用php函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM