User:Prisicilavilemen/Sandbox/API:Pageswithprop

GET request List all pages using a given page property.

Sample code
hello.py

Sample code
 "query", "list" => "pageswithprop", "pwppropname" => "displaytitle", "format" => "json" ];

$url = $endPoint. "?" . http_build_query( $params ); $ch = curl_init($url);

curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$output = curl_exec( $ch );

if (curl_errno($ch)) { echo("\r\n \r\n ******** \r\n"); print curl_error($ch); echo("\r\n ******** \r\n"); }

curl_close( $ch );

$result = json_decode( $output, true );

foreach( $result["query"]["pageswithprop"] as $k => $v ) { echo( $v["title"] . "\n" ); }