Не удалось прочитать начало записи SSL / TLS при вызове функции FullRequestSb для REST с использованием chilkat

Я пытаюсь создать календарь в моей учетной записи Gmail, используя REST API Chilkat. Но когда я выполняю эту строку

 success = rest.FullRequestSb(L"POST",L"/calendar/v3/calendars",sbReq,sbJson);

я получаю ошибку. есть ошибка мой журнал.

ChilkatLog:   FullRequestSb:
DllDate: May 24 2018
ChilkatVersion: 9.5.0.73
UnlockPrefix: Anything for 30-day trial
Architecture: Little Endian; 32-bit
Language: Visual C++ 9.0 (32-bit)
VerboseLogging: 0
fullRequestBody:
Sending request with body...
Sent request.
fullRequestGetResponse:
Reading response header...
Failed to read beginning of SSL/TLS record.
b: 0
dbSize: 0
nReadNBytes: 0
idleTimeoutMs: 30000
Failed to receive more TLS application data.
tlsApp: Socket operation timeout.
elapsedMs: Elapsed time: 30078 millisec
Failed.
Failed to read response header.
--fullRequestGetResponse
--fullRequestBody
Failed.   --FullRequestSb
--ChilkatLog

и вот мой код, который я использую.

CkGlobalW glob;
bool success = glob.UnlockBundle(L"Anything for 30-day trial");
const wchar_t* b1 = glob.lastErrorText();
CkRestW rest;

//   Provide a previously obtained OAuth2 access token.
CkOAuth2W oauth2;
oauth2.put_AccessToken(L"OAUTH2_ACCESS_TOKEN");
rest.SetAuthOAuth2(oauth2);

success = rest.Connect(L"imap.gmail.com",993,true,true);
if (success != true) {
const wchar_t* b = rest.lastErrorText();
return;
}

if(success == true)
{
success = rest.SetAuthBasic(L"[email protected]", L"password");
if(success == true)
{

//  The following code creates the JSON request body.
//  The JSON created by this code is shown below.

CkJsonObjectW jsonReq;
jsonReq.UpdateString(L"summary",L"test calendar abc");

CkStringBuilderW sbReq;
jsonReq.EmitSb(sbReq);

rest.AddHeader(L"Content-Type",L"application/json");

CkStringBuilderW sbJson;
success = rest.FullRequestSb(L"POST",L"/calendar/v3/calendars",sbReq,sbJson);
if (success != true) {
const wchar_t* b = rest.lastErrorText();
return;
}

if (rest.get_ResponseStatusCode() != 200) {
int statuscode = rest.get_ResponseStatusCode();
const wchar_t* str = sbJson.getAsString();
return;
}

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]