当前位置: 首页>>代码示例>>C++>>正文


C++ AuthRequest::authWebRequest方法代码示例

本文整理汇总了C++中AuthRequest::authWebRequest方法的典型用法代码示例。如果您正苦于以下问题:C++ AuthRequest::authWebRequest方法的具体用法?C++ AuthRequest::authWebRequest怎么用?C++ AuthRequest::authWebRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AuthRequest的用法示例。


在下文中一共展示了AuthRequest::authWebRequest方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AuthRequest

vector<Category*>* Session::GetCategories(string configId) {
    AuthRequest* authRequest = new AuthRequest(consumerKey, consumerSecret, configId, applicationName);
    QueryMethod method = GET;
    string url = host + "/categories." + format;
    cout << endl << "url: " << url << endl;
    int status = authRequest->authWebRequest(url, method);

    vector<Category*>* result = new vector<Category*>();
    if (status <= 202 && "" != authRequest->GetReceivedData()) {
        Stub_Categories* stub = new Stub_Categories();
        if (format == "xml") {
            (static_cast<XmlSerializer*>(serializer))->Deserialize(authRequest->GetReceivedData(), stub);
        } else {
            (static_cast<JsonSerializer*>(serializer))->Deserialize(authRequest->GetReceivedData(), stub);
        }
        result = stub->GetCategories();
        delete stub;
    }
    HandleRequest(method, url, "");
    HandleConfigurationResponse(status, authRequest);

    delete authRequest;

    return result;
}
开发者ID:Evtimm,项目名称:semantria-sdk,代码行数:25,代码来源:Session.cpp

示例2: QueueCollection

int Session::QueueCollection(Collection* collection, string configId) {
    AuthRequest* authRequest = new AuthRequest(consumerKey, consumerSecret, configId, applicationName);
    QueryMethod method = POST;
    string url = host + "/collection." + format;
    cout << endl << "url: " << url << endl;
    string body = "";
    if (format == "xml") {
        body = (static_cast<XmlSerializer*>(serializer))->Serialize(collection);
    } else {
        body = (static_cast<JsonSerializer*>(serializer))->Serialize(collection);
    }
    int result = authRequest->authWebRequest(url, method, body);

    HandleCollAutoResponse(result, authRequest);
    HandleRequest(method, url, body);

    delete authRequest;

    return result;
}
开发者ID:Evtimm,项目名称:semantria-sdk,代码行数:20,代码来源:Session.cpp

示例3: UpdateItems

int Session::UpdateItems(string path, UpdateProxy<T>* proxy, string configId) {
    AuthRequest* authRequest = new AuthRequest(consumerKey, consumerSecret, configId, applicationName);
    QueryMethod method = POST;
    string url = host + "/" + path + "." + format;
    cout << endl << "url: " << url << endl;
    string body = "";
    if (format == "xml") {
        body = (static_cast<XmlSerializer*>(serializer))->Serialize(proxy);
    } else {
        body = (static_cast<JsonSerializer*>(serializer))->Serialize(proxy);
    }

    int result = authRequest->authWebRequest(url, method, body);

    HandleRequest(POST, url, body);
    HandleConfigurationResponse(result, authRequest);

    delete authRequest;
    return result;
}
开发者ID:Evtimm,项目名称:semantria-sdk,代码行数:20,代码来源:Session.cpp

示例4: GetCollection

CollAnalyticData* Session::GetCollection(string collectionId, string configId) {
    AuthRequest* authRequest = new AuthRequest(consumerKey, consumerSecret, configId, applicationName);
    QueryMethod method = GET;
    string url = host + "/collection/" + collectionId + "." + format;
    cout << endl << "url: " << url << endl;
    int status = authRequest->authWebRequest(url, method);
    CollAnalyticData* result = new CollAnalyticData();
    if (status <= 202 && "" != authRequest->GetReceivedData()) {
        if (format == "xml") {
            (static_cast<XmlSerializer*>(serializer))->Deserialize(authRequest->GetReceivedData(), result);
        } else {
            (static_cast<JsonSerializer*>(serializer))->Deserialize(authRequest->GetReceivedData(), result);
        }
    }
    HandleRequest(method, url, "");
    HandleConfigurationResponse(status, authRequest);

    delete authRequest;

    return result;
}
开发者ID:Evtimm,项目名称:semantria-sdk,代码行数:21,代码来源:Session.cpp

示例5: VerifySubscription

Subscription* Session::VerifySubscription() {
    AuthRequest* authRequest = new AuthRequest(consumerKey, consumerSecret, "", applicationName);
    QueryMethod method = GET;
    string url = host + "/subscription." + format;
    cout << endl << "url: " << url << endl;
    int status = authRequest->authWebRequest(url, method);

    Subscription* result = new Subscription();
    if (status <= 202 && "" != authRequest->GetReceivedData()) {
        if (format == "xml") {
            (static_cast<XmlSerializer*>(serializer))->Deserialize(authRequest->GetReceivedData(), result);
        } else {
            (static_cast<JsonSerializer*>(serializer))->Deserialize(authRequest->GetReceivedData(), result);
        }
    }
    HandleRequest(method, url, "");
    HandleConfigurationResponse(status, authRequest);

    delete authRequest;

    return result;
}
开发者ID:Evtimm,项目名称:semantria-sdk,代码行数:22,代码来源:Session.cpp

示例6: QueueBatch

int Session::QueueBatch(vector<Document*>* documents, string configId) {
    AuthRequest* authRequest = new AuthRequest(consumerKey, consumerSecret, configId, applicationName);
    QueryMethod method = POST;
    string url = host + "/document/batch." + format;
    cout << endl << "url: " << url << endl;
    Stub_Tasks* documentsStub = new Stub_Tasks(documents);
    string body = "";
    if (format == "xml") {
        body = (static_cast<XmlSerializer*>(serializer))->Serialize(documentsStub);
    } else {
        body = (static_cast<JsonSerializer*>(serializer))->Serialize(documentsStub);
    }
    delete documentsStub;

    int result = authRequest->authWebRequest(url, method, body);

    HandleDocAutoResponse(result, authRequest);
    HandleRequest(method, url, body);

    delete authRequest;
    return result;
}
开发者ID:Evtimm,项目名称:semantria-sdk,代码行数:22,代码来源:Session.cpp


注:本文中的AuthRequest::authWebRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。