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; }
/*! * \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); }
RequestInfo(Request* aRequest, const RequestParams& aParams) : PendingRequestInfo(aRequest) , mParams(aParams) { MOZ_ASSERT(aRequest); MOZ_ASSERT(aParams.type() != RequestParams::T__None); }
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); } }