后继 api php 卷曲
任何人都会发现这有什么问题,它不起作用并且返回 null。
$request = array(
"api_token" => $token,
"name" => null,
"byline" => "via api",
"owner_id" => null,
"id" => $id,
"raw_theme" => $t,
"friendly_name" => "Test"
);
$session = curl_init($url);
curl_setopt($session, CURLOPT_USERPWD, $user . ":" . $password);
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $request);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);
var_dump($response);
Anyone see anything wrong with this, it is not working and its returning null.
$request = array(
"api_token" => $token,
"name" => null,
"byline" => "via api",
"owner_id" => null,
"id" => $id,
"raw_theme" => $t,
"friendly_name" => "Test"
);
$session = curl_init($url);
curl_setopt($session, CURLOPT_USERPWD, $user . ":" . $password);
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $request);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);
var_dump($response);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定,但如果我尝试从 https://posterous.com/api 然后 post 参数的命名如下:
因此,也许您应该尝试将代码更改为类似以下内容:
另外,我没有看到任何
owner_id
、name
或id 参数。
I'm not sure but if I try to send a create new theme request from https://posterous.com/api then the post parameters are named like:
So, perhaps you should try changing your code into something like:
Also, I don't see any
owner_id
,name
orid
parameters in their example.