Php 在jqueryajax中查找GET属性
我从一个网页获取数据,它有一个jQuery Ajax请求。它的方法是GET,它有一些数据,我想知道如何使用cURL-php发送请求 我确实运行了一个curl会话,并使用Php 在jqueryajax中查找GET属性,php,jquery,php-curl,Php,Jquery,Php Curl,我从一个网页获取数据,它有一个jQuery Ajax请求。它的方法是GET,它有一些数据,我想知道如何使用cURL-php发送请求 我确实运行了一个curl会话,并使用curl\u setopt($ch,CURLOPT\u POSTFIELDS,$datas)发送了数据。 但它没有回应 // $.ajax({type: 'GET', dataType: 'json', url : 'http://example.com/some', data: $('#media_form').serializ
curl\u setopt($ch,CURLOPT\u POSTFIELDS,$datas)发送了数据。
但它没有回应
// $.ajax({type: 'GET', dataType: 'json', url : 'http://example.com/some', data: $('#media_form').serialize()})
// $('#media_form').serialize() = string=string&link=https%3A%2F%2Fexample.com
实际上,我将数组中的#media#form数据放入cURL中的postfields中,但实际上我甚至不知道应该如何发送请求。如何在GET中发送没有任何属性的数据?
GET
参数放在URL中,而不是POST
字段中
因此,它应该是:
$url = 'http://example.com/some?string=string&link=https%3A%2F%2Fexample.com';
您可以使用
http\u build\u str()
函数从参数的关联数组构造查询字符串。GET
参数放在URL中,而不是POST
字段中
因此,它应该是:
$url = 'http://example.com/some?string=string&link=https%3A%2F%2Fexample.com';
您可以使用http\u build\u str()
函数从参数的关联数组构造查询字符串