質問編集履歴

4

urlの修正

2018/06/16 13:49

投稿

tMga2
tMga2

スコア8

test CHANGED
File without changes
test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  <?php
16
16
 
17
- $qiita_API_URL = 'http:/authenticated_user/items?page=1&per_page=20';
17
+ $qiita_API_URL = 'https://qiita.com/api/v2/authenticated_user/items?page=1&per_page=20';
18
18
 
19
19
  $curl = curl_init($qiita_API_URL);
20
20
 

3

誤字

2018/06/16 13:49

投稿

tMga2
tMga2

スコア8

test CHANGED
File without changes
test CHANGED
@@ -15,38 +15,6 @@
15
15
  <?php
16
16
 
17
17
  $qiita_API_URL = 'http:/authenticated_user/items?page=1&per_page=20';
18
-
19
- $curl = curl_init($qiita_API_URL);
20
-
21
- $option = [
22
-
23
- CURLOPT_CUSTOMREQUEST => 'GET',
24
-
25
- CURLOPT_HTTPHEADER => [
26
-
27
- 'Authorization: Bearer ',
28
-
29
- 'Content-Type: application/json',
30
-
31
- ],
32
-
33
- ];
34
-
35
-
36
-
37
- curl_setopt_array($curl, $option);
38
-
39
- $result = curl_exec($curl);
40
-
41
- curl_close($curl);
42
-
43
- $tmp = json_encode($result);
44
-
45
- var_dump((array) $tmp);
46
-
47
-
48
-
49
- //$qiita_API_URL = 'http://qiita.com/api/v2/items';
50
18
 
51
19
  $curl = curl_init($qiita_API_URL);
52
20
 

2

URLの変更

2018/06/16 13:07

投稿

tMga2
tMga2

スコア8

test CHANGED
File without changes
test CHANGED
@@ -15,6 +15,36 @@
15
15
  <?php
16
16
 
17
17
  $qiita_API_URL = 'http:/authenticated_user/items?page=1&per_page=20';
18
+
19
+ $curl = curl_init($qiita_API_URL);
20
+
21
+ $option = [
22
+
23
+ CURLOPT_CUSTOMREQUEST => 'GET',
24
+
25
+ CURLOPT_HTTPHEADER => [
26
+
27
+ 'Authorization: Bearer ',
28
+
29
+ 'Content-Type: application/json',
30
+
31
+ ],
32
+
33
+ ];
34
+
35
+
36
+
37
+ curl_setopt_array($curl, $option);
38
+
39
+ $result = curl_exec($curl);
40
+
41
+ curl_close($curl);
42
+
43
+ $tmp = json_encode($result);
44
+
45
+ var_dump((array) $tmp);
46
+
47
+
18
48
 
19
49
  //$qiita_API_URL = 'http://qiita.com/api/v2/items';
20
50
 

1

誤字

2018/06/16 12:57

投稿

tMga2
tMga2

スコア8

test CHANGED
File without changes
test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  CURLOPT_HTTPHEADER => [
28
28
 
29
- 'Authorization: Bearer 435a490008879d430634708133951af0897de64d',
29
+ 'Authorization: Bearer ',
30
30
 
31
31
  'Content-Type: application/json',
32
32