本文整理汇总了C++中HttpRequest::SetEntity方法的典型用法代码示例。如果您正苦于以下问题:C++ HttpRequest::SetEntity方法的具体用法?C++ HttpRequest::SetEntity怎么用?C++ HttpRequest::SetEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequest
的用法示例。
在下文中一共展示了HttpRequest::SetEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RequestHttpPost
result Chatting::RequestHttpPost(void) {
result r = E_SUCCESS;
HttpSession* pSession = null;
HttpTransaction* pTransaction = null;
HttpRequest* pRequest = null;
HttpMultipartEntity* pMultipartEntity = null;
String hostAddr(HTTP_CLIENT_HOST_ADDRESS);
// Creates an HTTP session.
pSession = new HttpSession();
r = pSession->Construct(NET_HTTP_SESSION_MODE_NORMAL, null, hostAddr, null);
pTransaction = pSession->OpenTransactionN();
r = pTransaction->AddHttpTransactionListener(*this);
// r = pTransaction->SetHttpProgressListener(*this);
pRequest = pTransaction->GetRequest();
pRequest->SetMethod(NET_HTTP_METHOD_POST);
r = pRequest->SetUri(HTTP_CLIENT_REQUEST_URI);
pMultipartEntity = new HttpMultipartEntity();
r = pMultipartEntity->Construct();
String me = __pEditField->GetText();
Tizen::Text::Encoding* pEnc = Tizen::Text::Encoding::GetEncodingN(L"UTF-8");
pMultipartEntity->AddStringPart(L"message", me, L"text/plain", L"UTF-8",
*pEnc);
r = pMultipartEntity->AddStringPart(L"friendIdRegId", resultRegId);
r = pRequest->SetEntity(*pMultipartEntity);
r = pTransaction->Submit();
return r;
}