简体   繁体   English

Wordpress Jetpack Json API无法正常工作

[英]Wordpress Jetpack Json API not working

i'm trying to use Json API from Jetpack, but when i make the call i only get this: 我正在尝试使用Jetpack的Json API,但是当我打电话时,我只会得到这个:

{"error":"unknown_blog","message":"Unknown blog"}

I'm trying this: https://public-api.wordpress.com/rest/v1.1/sites/clasari.com/wp/posts/ 我正在尝试: https : //public-api.wordpress.com/rest/v1.1/sites/clasari.com/wp/posts/

The blog is hosted at wp folder (inside clasari.com) solo the blog url is clasari.com/wp, i guess that can be a problem. 博客托管在wp文件夹(位于clasari.com内部)中,博客网址为clasari.com/wp,我想这可能是个问题。

I've also tried 我也尝试过

https://public-api.wordpress.com/rest/v1.1/sites/clasari.com::wp/posts/ https://public-api.wordpress.com/rest/v1.1/sites/clasari.com::wp/posts/

but it has the same result. 但结果相同。

Any idea of what can be this problem? 知道这可能是什么问题吗? Thank you for your help 谢谢您的帮助

You need to use urlencode , like this: 您需要使用urlencode ,如下所示:

$url = 'clasari.com/wp';
$url = url_encode( $url );

$request =
  'https://public-api.wordpress.com/rest/v1.1/sites/' .
  $url .
  '/posts/';

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

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