我正在尝试转换此网址https://api.instagram.com/v1/users/self/?access_token=123456789
我可以用guzzle一些东西。到目前为止我已经:
$token = "123456789";
$client = new \GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.instagram.com/v1/users/self/', [
'access_token' => $token
]);
echo $res->getStatusCode();
// 200
echo $res->getHeaderLine('content-type');
// 'application/json; charset=utf8'
echo $res->getBody();
// {"type":"User"...'
但我收到的错误是:
Client error: `GET https://api.instagram.com/v1/users/self/` resulted in a `400 BAD REQUEST` response:
{"meta": {"error_type": "OAuthParameterException", "code": 400, "error_message": "Missing client_id or access_token URL (truncated...)
答案 0 :(得分:3)
您应该将您的令牌放在import Ember from 'ember';
export default Ember.Route.extend({
session: Ember.inject.service(),
thing(params) {
// Do some check and returns the result
},
beforeModel (transition) {
if (!this.thing(transition.params)) {
transition.abort();
this.transitionTo('/login');
}
}
});
中,如下所示:
query