Hello,
Jens Lehmann schrieb:
> Hello,
>
> $headers = array("Content-Type: ".$this->contentType);
> $c = curl_init();
> curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($c, CURLOPT_URL, $url);
> curl_setopt($c, CURLOPT_HTTPHEADER, $headers);
> $contents = curl_exec($c);
> curl_close($c);
Here is the corresponding POST code:
$c = curl_init();
$headers = array("Accept: application/sparql-results+JSON");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_URL, "http://dbpedia.org/sparql");
curl_setopt($c, CURLOPT_HTTPHEADER, $headers);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, "query=$query");
$contents = curl_exec($c);
echo curl_error($c);
curl_close($c);
Kind regards,
Jens
------------------------------------------------------------------------------
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion