예제 #1
0
int main(int argc, char** argv){
    if( argc < 2){
        std::cout << "Usage " << argv[0] << " [url]" << std::endl;
        return 0;
    }

    davix_set_log_level(DAVIX_LOG_ALL);
    RequestParams params;
    DavixError* tmp_err=NULL;

    Context c;
    if(argc >2 ){ // setup ops if credential is found
         params.setSSLCAcheck(false);
    }
    HttpRequest r(c, argv[1], &tmp_err);
    r.setParameters(params);
    r.addHeaderField("Depth", "1");

    std::vector<char> body = req_webdav_propfind(&r, &tmp_err);
    std::string v(body.begin(), body.end());

    std::cout << "content "<< v << std::endl;
    if(tmp_err){
        std::cerr << " req error " << tmp_err->getErrMsg() << std::endl;
    }
    return 0;
}
예제 #2
0
파일: qupyun.cpp 프로젝트: devbean/QUpYun
/*!
 * \brief Makes a directory at \a path.
 *
 * Sets \a autoMkdir to true if auto mkdir needed.
 *
 * \sa QUpYun::requestMkdirFinished(bool)
 */
void QUpYun::mkdir(const QString &path, bool autoMkdir)
{
    RequestParams params;
    params.insert(MKDIR, QLatin1String("true"));
    QNetworkReply *reply = d->sendRequest(QNetworkAccessManager::PutOperation,
                                          d->formatPath(path),
                                          QByteArray(),
                                          autoMkdir,
                                          params);
    d->requests.insert(reply, Mkdir);
}
예제 #3
0
 RequestInfo(Request* aRequest,
             const RequestParams& aParams)
   : PendingRequestInfo(aRequest)
   , mParams(aParams)
 {
   MOZ_ASSERT(aRequest);
   MOZ_ASSERT(aParams.type() != RequestParams::T__None);
 }
예제 #4
0
void
IDBTransaction::StartRequest(BackgroundRequestChild* aBackgroundActor,
                             const RequestParams& aParams)
{
  AssertIsOnOwningThread();
  MOZ_ASSERT(aBackgroundActor);
  MOZ_ASSERT(aParams.type() != RequestParams::T__None);

  if (mMode == VERSION_CHANGE) {
    MOZ_ASSERT(mBackgroundActor.mVersionChangeBackgroundActor);

    mBackgroundActor.mVersionChangeBackgroundActor->
      SendPBackgroundIDBRequestConstructor(aBackgroundActor, aParams);
  } else {
    MOZ_ASSERT(mBackgroundActor.mNormalBackgroundActor);

    mBackgroundActor.mNormalBackgroundActor->
      SendPBackgroundIDBRequestConstructor(aBackgroundActor, aParams);
  }
}