Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
piphone-front
Commits
98811ef7
Commit
98811ef7
authored
Aug 07, 2016
by
okhin
Browse files
We want to follow the 302 and the likes, also enforcing json content-type.
parent
dac45805
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Api.php
View file @
98811ef7
...
...
@@ -9,8 +9,9 @@ class Api {
$curl
=
curl_init
();
$url
=
API_BASE
.
$url
.
"/?format=json"
;
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
);
//
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt
(
$curl
,
CURLOPT_HTTPHEADER
,
array
(
'Content-type: application/json'
));
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$ch
,
CURLOPT_FOLLOWLOCATION
,
1
);
$result
=
curl_exec
(
$curl
);
curl_close
(
$curl
);
return
$result
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment