Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
ecef39c145d5fcf72d79d7b890ea541c582f6c8e
1 parent
bd187acd
修复post方式为x-www-form-urlencodedd方式
Code Review By Rock Zhang
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
library/Api/Yohobuy.php
library/Api/Yohobuy.php
View file @
ecef39c
...
...
@@ -212,7 +212,16 @@ class Yohobuy
unset
(
$data
[
'private_key'
]);
}
if
(
!
empty
(
$data
))
{
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$data
);
// 新加支持application/x-www-form-urlencoded调用方式
$str
=
''
;
foreach
(
$data
as
$key
=>
$val
)
{
$str
.=
$key
.
'='
.
$val
.
'&'
;
}
$str
=
rtrim
(
$str
,
'&'
);
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$str
);
}
$result
=
curl_exec
(
$ch
);
if
(
!
$returnJson
&&
!
empty
(
$result
))
{
...
...
Please
register
or
login
to post a comment