質問するログイン新規登録

質問編集履歴

4

urlの修正

2018/06/16 13:49

投稿

tMga2
tMga2

スコア8

title CHANGED
File without changes
body CHANGED
@@ -6,7 +6,7 @@
6
6
  ```php
7
7
 
8
8
  <?php
9
- $qiita_API_URL = 'http:/authenticated_user/items?page=1&per_page=20';
9
+ $qiita_API_URL = 'https://qiita.com/api/v2/authenticated_user/items?page=1&per_page=20';
10
10
  $curl = curl_init($qiita_API_URL);
11
11
  $option = [
12
12
  CURLOPT_CUSTOMREQUEST => 'GET',

3

誤字

2018/06/16 13:49

投稿

tMga2
tMga2

スコア8

title CHANGED
File without changes
body CHANGED
@@ -22,24 +22,8 @@
22
22
  $tmp = json_encode($result);
23
23
  var_dump((array) $tmp);
24
24
 
25
- //$qiita_API_URL = 'http://qiita.com/api/v2/items';
26
- $curl = curl_init($qiita_API_URL);
27
- $option = [
28
- CURLOPT_CUSTOMREQUEST => 'GET',
29
- CURLOPT_HTTPHEADER => [
30
- 'Authorization: Bearer ',
31
- 'Content-Type: application/json',
32
- ],
33
- ];
34
25
 
35
- curl_setopt_array($curl, $option);
36
- $result = curl_exec($curl);
37
- curl_close($curl);
38
- $tmp = json_encode($result);
39
- var_dump((array) $tmp);
40
26
 
41
-
42
-
43
27
  ```
44
28
  ターミナルでの実行結果
45
29
  ```

2

URLの変更

2018/06/16 13:07

投稿

tMga2
tMga2

スコア8

title CHANGED
File without changes
body CHANGED
@@ -7,6 +7,21 @@
7
7
 
8
8
  <?php
9
9
  $qiita_API_URL = 'http:/authenticated_user/items?page=1&per_page=20';
10
+ $curl = curl_init($qiita_API_URL);
11
+ $option = [
12
+ CURLOPT_CUSTOMREQUEST => 'GET',
13
+ CURLOPT_HTTPHEADER => [
14
+ 'Authorization: Bearer ',
15
+ 'Content-Type: application/json',
16
+ ],
17
+ ];
18
+
19
+ curl_setopt_array($curl, $option);
20
+ $result = curl_exec($curl);
21
+ curl_close($curl);
22
+ $tmp = json_encode($result);
23
+ var_dump((array) $tmp);
24
+
10
25
  //$qiita_API_URL = 'http://qiita.com/api/v2/items';
11
26
  $curl = curl_init($qiita_API_URL);
12
27
  $option = [

1

誤字

2018/06/16 12:57

投稿

tMga2
tMga2

スコア8

title CHANGED
File without changes
body CHANGED
@@ -12,7 +12,7 @@
12
12
  $option = [
13
13
  CURLOPT_CUSTOMREQUEST => 'GET',
14
14
  CURLOPT_HTTPHEADER => [
15
- 'Authorization: Bearer 435a490008879d430634708133951af0897de64d',
15
+ 'Authorization: Bearer ',
16
16
  'Content-Type: application/json',
17
17
  ],
18
18
  ];