Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
ZxAd_Unity
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
ZxAd_Unity
Commits
a9b9ed11
Commit
a9b9ed11
authored
May 26, 2021
by
张广义
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zxad_1.3.5' of gitlab.huolea.com:wangxuewei/zxad_unity into zxad_1.3.5
parents
d65f88d5
a42da6c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
42 deletions
+0
-42
AdHttpUtil.cs
Assets/AdSDK/AD/ADNet/AdHttpUtil.cs
+0
-42
No files found.
Assets/AdSDK/AD/ADNet/AdHttpUtil.cs
View file @
a9b9ed11
...
@@ -88,48 +88,6 @@ public class AdHttpUtil : MonoBehaviour
...
@@ -88,48 +88,6 @@ public class AdHttpUtil : MonoBehaviour
}
}
}
}
//jsonString 为json字符串,post提交的数据包为json
public
void
_Post
<
T
>(
string
methodName
,
Dictionary
<
string
,
object
>
postParas
,
Action
<
T
>
success
,
Action
<
string
,
string
>
failed
)
{
StartCoroutine
(
PostRequest
(
BaseGameUrl
,
methodName
,
""
,
postParas
,
success
,
failed
));
}
private
IEnumerator
PostRequest
<
T
>(
string
BaseURL
,
string
methodName
,
string
jsonString
,
Dictionary
<
string
,
object
>
postParas
,
Action
<
T
>
success
,
Action
<
string
,
string
>
failed
)
{
string
url
=
BaseURL
+
methodName
+
"?"
+
HttpUtil
.
addParams
(
postParas
);
using
(
UnityWebRequest
webRequest
=
new
UnityWebRequest
(
url
,
"POST"
))
{
if
(
jsonString
!=
null
&&
jsonString
.
Length
>
0
)
{
byte
[]
bodyRaw
=
Encoding
.
UTF8
.
GetBytes
(
jsonString
);
webRequest
.
uploadHandler
=
(
UploadHandler
)
new
UploadHandlerRaw
(
bodyRaw
);
}
webRequest
.
downloadHandler
=
(
DownloadHandler
)
new
DownloadHandlerBuffer
();
foreach
(
var
v
in
requestHeader
)
{
webRequest
.
SetRequestHeader
(
v
.
Key
,
(
string
)
v
.
Value
);
}
webRequest
.
timeout
=
timeOut
;
yield
return
webRequest
.
SendWebRequest
();
if
(
webRequest
.
isHttpError
||
webRequest
.
isNetworkError
)
{
Debug
.
unityLogger
.
Log
(
"error:"
+
webRequest
.
error
+
"\n"
+
webRequest
.
downloadHandler
.
text
);
if
(
failed
!=
null
)
{
failed
(
webRequest
.
error
,
webRequest
.
downloadHandler
.
text
);
}
}
else
{
string
json
=
webRequest
.
downloadHandler
.
text
;
RequestResult
(
"POST RequestUrl=> "
+
url
,
json
,
success
,
failed
);
}
}
}
private
void
RequestResult
<
T
>(
string
debugUrl
,
string
json
,
Action
<
T
>
success
,
Action
<
string
,
string
>
failed
)
private
void
RequestResult
<
T
>(
string
debugUrl
,
string
json
,
Action
<
T
>
success
,
Action
<
string
,
string
>
failed
)
{
{
Debug
.
unityLogger
.
Log
(
HttpLogTag
,
debugUrl
);
Debug
.
unityLogger
.
Log
(
HttpLogTag
,
debugUrl
);
...
...
Write
Preview
Markdown
is supported
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