Skip to content

Commit 5616c86

Browse files
committed
modify:post try add payload type
1 parent dc2e4b3 commit 5616c86

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

XEngine_Module/XEngine_Verification/Verification_XAuth/Verification_XAuthNet.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ bool CVerification_XAuthNet::Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAdd
5555
JSONCPP_STRING st_JsonError;
5656
Json::CharReaderBuilder st_ReaderBuilder;
5757
SYSTEMAPI_SERIAL_INFOMATION st_SDKSerial = {};
58+
LPCSTR lpszCustomHdr = "Content-Type: application/json\r\n";
5859

5960
SystemApi_HardWare_GetSerial(&st_SDKSerial);
6061
_xstprintf(tszJsonStr, _X("%s"), st_SDKSerial.tszBoardSerial);
@@ -72,7 +73,7 @@ bool CVerification_XAuthNet::Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAdd
7273

7374
nMsgLen = st_JsonRoot.toStyledString().length();
7475
Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENCodec, lpszPass);
75-
if (!APIClient_Http_Request(_X("POST"), lpszURLAddr, tszENCodec, &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
76+
if (!APIClient_Http_Request(_X("POST"), lpszURLAddr, tszENCodec, &nHTTPCode, &ptszMsgBuffer, &nMsgLen, lpszCustomHdr))
7677
{
7778
Verification_IsErrorOccur = true;
7879
Verification_dwErrorCode = APIClient_GetLastError();
@@ -93,7 +94,7 @@ bool CVerification_XAuthNet::Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAdd
9394
}
9495
else
9596
{
96-
if (!APIClient_Http_Request(_X("POST"), lpszURLAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
97+
if (!APIClient_Http_Request(_X("POST"), lpszURLAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen, lpszCustomHdr))
9798
{
9899
Verification_IsErrorOccur = true;
99100
Verification_dwErrorCode = APIClient_GetLastError();

0 commit comments

Comments
 (0)