Skip to content

Commit 1a162af

Browse files
committed
Change response
1 parent 727262e commit 1a162af

File tree

1 file changed

+33
-16
lines changed

1 file changed

+33
-16
lines changed

README.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ print_r($posts);
3131
echo '</pre>';
3232
```
3333

34-
Response:
34+
Response Success:
3535

3636
Body = All respon from Wordpress api
3737
Total = Total Item from X-WP-TOTAL
@@ -41,21 +41,38 @@ TotalPages = Total Page From X-WP-TOTALPAGE
4141
Array
4242
(
4343
44-
[body] => Array
45-
(
46-
xxxxxxxxxx
47-
xxxxxxxxxx
48-
)
49-
50-
[total] => Array
51-
(
52-
xxxxxxxxxx
53-
)
54-
55-
[totalpages] => Array
56-
(
57-
xxxxxxxxxx
58-
)
44+
[status] => success
45+
[code] => 200
46+
[data] => Array(
47+
48+
id =>
49+
slug =>
50+
xxxx
51+
)
52+
[X-WP-TOTAL] => 6909
53+
[X-WP-TOTAL-PAGE] => 70
54+
55+
)
56+
```
57+
58+
Response Error:
59+
60+
Body = All respon from Wordpress api
61+
Total = Total Item from X-WP-TOTAL
62+
TotalPages = Total Page From X-WP-TOTALPAGE
63+
64+
```Array
65+
Array
66+
(
67+
68+
[status] => success
69+
[code] => 200
70+
[error] => Array(
71+
72+
message =>
73+
74+
)
75+
5976
6077
)
6178
```

0 commit comments

Comments
 (0)