generators404notfound

404notfound  时间:2021-02-25  阅读:()
Package'reqres'October2,2019TypePackageTitlePowerfulClassesforHTTPRequestsandResponsesVersion0.
2.
3MaintainerThomasLinPedersenDescriptionInordertofacilitateparsingofhttprequestsandcreatingappropriateresponsesthispackageprovidestwoclassestohandlealotofthehousekeepinginvolvedinworkingwithhttpexchanges.
Theinfrastructurebuildsuponthe'rook'specicationandisthuswellsuitedtobecombinedwith'httpuv'basedwebservers.
LicenseMIT+leLICENSEEncodingUTF-8LazyDataTRUEDependsR(>=2.
10)ImportsR6,assertthat,stringi,urltools,tools,brotli,jsonlite,xml2,webutils,utilsRoxygenNote6.
1.
1Suggestsery,testthat,covrURLhttps://reqres.
data-imaginist.
com,https://github.
com/thomasp85/reqres#reqresBugReportshttps://github.
com/thomasp85/reqres/issuesNeedsCompilationnoAuthorThomasLinPedersen[cre,aut]()RepositoryCRANDate/Publication2019-10-0220:00:03UTC12default_formattersRtopicsdocumented:default_formatters2default_parsers3formatters3parsers5Request7Response11to_http_date14Index16default_formattersAlistofdefaultformattermappingsDescriptionThislistmatchesthemostnormalmimetypeswiththeirrespectiveformattersusingdefaultargu-ments.
Forano-frillsrequestparsingthiscanbesupplieddirectlytoResponse$format().
Toaddormodifytothislistsimplysupplytheadditionalparsersassecond,third,etc,argumentandtheywilloverwriteoradddependingonwhetheritspeciesamimetypealreadypresent.
Usagedefault_formattersSeeAlsoformattersforanoverviewofthebuildinformattersinreqresExamples##Notrun:res$format(default_formatters,text/plain=format_plain(sep=))##End(Notrun)default_parsers3default_parsersAlistofdefaultparsermappingsDescriptionThislistmatchesthemostnormalmimetypeswiththeirrespectiveparsersusingdefaultarguments.
Forano-frillsrequestparsingthiscanbesupplieddirectlytoRequest$parse().
Toaddormod-ifytothislistsimplysupplytheadditionalparsersassecond,third,etc,argumentandtheywilloverwriteoradddependingonwhetheritspeciesamimetypealreadypresent.
Usagedefault_parsersSeeAlsoparsersforanoverviewofthebuildinparsersinreqresExamples##Notrun:req$parse(default_parsers,application/json=parse_json(flatten=TRUE))##End(Notrun)formattersPre-suppliedformattinggeneratorsDescriptionThissetoffunctionscanbeusedtoconstructformattingfunctionsadheringtotheResponse$format()requirements.
Usageformat_json(dataframe="rows",matrix="rowmajor",Date="ISO8601",POSIXt="string",factor="string",complex="string",raw="base64",null="list",na="null",auto_unbox=FALSE,digits=4,pretty=FALSE,force=FALSE)format_plain(sep="\n")format_xml(encoding="UTF-8",options="as_xml")format_html(encoding="UTF-8",options="as_html")format_table(.
.
.
)4formattersArgumentsdataframehowtoencodedata.
frameobjects:mustbeoneof'rows','columns'or'values'matrixhowtoencodematricesandhigherdimensionalarrays:mustbeoneof'rowma-jor'or'columnmajor'.
DatehowtoencodeDateobjects:mustbeoneof'ISO8601'or'epoch'POSIXthowtoencodePOSIXt(datetime)objects:mustbeoneof'string','ISO8601','epoch'or'mongo'factorhowtoencodefactorobjects:mustbeoneof'string'or'integer'complexhowtoencodecomplexnumbers:mustbeoneof'string'or'list'rawhowtoencoderawobjects:mustbeoneof'base64','hex'or'mongo'nullhowtoencodeNULLvalueswithinalist:mustbeoneof'null'or'list'nahowtoprintNAvalues:mustbeoneof'null'or'string'.
Defaultsareclassspecicauto_unboxautomaticallyunboxallatomicvectorsoflength1.
Itisusuallysafertoavoidthisandinsteadusetheunboxfunctiontounboxindividualelements.
Anex-ceptionisthatobjectsofclassAsIs(i.
e.
wrappedinI())arenotautomaticallyunboxed.
Thisisawaytomarksinglevaluesaslength-1arrays.
digitsmaxnumberofdecimaldigitstoprintfornumericvalues.
UseI()tospecifysignicantdigits.
UseNAformaxprecision.
prettyaddsindentationwhitespacetoJSONoutput.
CanbeTRUE/FALSEoranumberspecifyingthenumberofspacestoindent.
Seeprettifyforceunclass/skipobjectsofclasseswithnodenedJSONmappingsepThelineseparator.
Plaintextwillbesplitintomultiplestringsbasedonthis.
encodingThecharacterencodingtouseinthedocument.
Thedefaultencodingis'UTF-8'.
Availableencodingsarespeciedathttp://xmlsoft.
org/html/libxml-encoding.
html#xmlCharEncoding.
optionsdefault:'format'.
ZeroormoreofformatFormatoutputno_declarationDroptheXMLdeclarationno_empty_tagsRemoveemptytagsno_xhtmlDisableXHTML1rulesrequire_xhtmlForceXHTML1rulesas_xmlForceXMLoutputas_htmlForceHTMLoutputformat_whitespaceFormatwithnon-signicantwhitespace.
.
.
parameterspassedontowrite.
table()ValueAfunctionacceptinganRobjectparsers5SeeAlsoparsersforconvertingRequestbodiesintoRobjectsdefault_formattersforalistthatmapsthemostcommonmimetypestotheirrespectiveformattersExamplesfake_rook.
Usethetypeargumenttooverwritetheautomatictypeinferencefromtheleextension.
status_with_text(code)Setsthestatustocodeandsetsthebodytotheassociatedstatuscodedescription(e.
g.
BadGatewayfor502L)set_cookie(name,value,encode=TRUE,expires=NULL,http_only=NULL,max_age=NULL,path=NULL,secureAddsthecookiegivenbynametothegivenvalue,optionallyurlencodingit,alongwithanyadditionaldirectives.
Seehttps://developer.
mozilla.
org/en-US/docs/Web/HTTP/Headers/Set-Cookieforadescriptionofthedifferentdirectives.
Ifthecookiealreadyexistsitwillbeoverwritten.
Thevalidityofthedirectiveswillautomaticallybechecked.
expiresexpectsaPOSIXctobject,http_onlyandsecureexpectalogical,max_ageexpectsaninte-ger,pathastring,andsame_siteeither"Lax"or"Strict"remove_cookie(name)Removesthecookienamednamefromtheresponse.
has_cookie(name)Querieswhethertheresponsecontainsacookienamednameset_links(.
.
.
)SetstheLinkheaderbasedonthenamedargumentspassedto.
.
.
.
Thenameswillbeusedforthereldirective.
format(.
.
.
,autofail=TRUE,compress=TRUE)Basedontheformatterspassedinthrough.
.
.
contentnegotiationisperformedwithrequestandthepreferredformatterischosen.
TheContent-Typeheaderissetautomatically.
Ifcompress=TRUEthecompress()methodwillbecalledafterformatting.
Ifanerrorisencounteredandautofail=TRUEtheresponsewillbesetto500.
Ifaformatterisnotfoundandautofail=TRUEtheresponsewillbesetto406.
IfformattingissuccessfulitwillreturnTRUE,ifnotitwillreturnFALSEcompress(priority=c('gzip','deflate','br','identity'))Basedontheprovidedpri-ority,anencodingisnegotiatedwiththerequestandapplied.
TheContent-Encodingheaderissettothechosencompressionalgorithm.
content_length()Calculatesthelength(inbytes)ofthebody.
ThisisthenumberthatgoesintotheContent-Lengthheader.
NotethattheContent-Lengthheaderissetautomaticallybyhttpuvsothismethodshouldonlybecallediftheresponsesizeisneededforotherreasons.
as_list()ConvertstheobjecttoalistforfurtherprocessingbyaRookcompliantserversuchashttpuv.
WillsetContent-Typeheaderifmissingandconvertanon-rawbodytoasinglecharacterstring.
SeeAlsoRequestforhandlinghttprequestsExamplesfake_rook<-fiery::fake_request(http://example.
com/testid=34632&question=who+is+hadley,content=Thisiselaborateruse,headers=list(Accept=application/json;text/*,Content_Type=text/plain))14to_http_datereq<-Request$new(fake_rook)res<-Response$new(req)res#Setthebodytotheassociatedstatustextres$status_with_text(200L)res$body#InferContent-Typefromfileextensionres$type<-jsonres$type#Prepareafilefordownloadres$attach(system.
file(DESCRIPTION,package=reqres))res$typeres$bodyres$get_header(Content-Disposition)#Cleaningupconnectionsrm(fake_rook,req,res)gc()to_http_dateFormattimestampstomatchtheHTTPspecsDescriptionDates/timesinHTTPheadersneedsaspecicformattobevalid,andisfurthermorealwaysgiveninGMTtime.
Thesetwofunctionsaidsinconvertingbackandforthbetweentherequiredformat.
Usageto_http_date(time,format=NULL)from_http_date(time)ArgumentstimeAstringoranobjectcoercibletoPOSIXctformatIncasetimeisnotaPOSIXctobjectaspecicationhowthestringshouldbeinterpreted.
Valueto_http_date()returnsaproperlyformattedstring,whilefrom_http_date()returnsaPOSIXctobjectto_http_date15Examplestime<-to_http_date(Sys.
time())timefrom_http_date(time)IndexTopicdatasetsdefault_formatters,2default_parsers,3Request,7Response,11as.
list.
Response(Response),11as.
Request(Request),7default_formatters,2,5default_parsers,3,7flatten,6format_html(formatters),3format_json(formatters),3format_plain(formatters),3format_table(formatters),3format_xml(formatters),3formatters,2,3,7from_http_date(to_http_date),14is.
Request(Request),7is.
Response(Response),11parse_html(parsers),5parse_json(parsers),5parse_multiform(parsers),5parse_plain(parsers),5parse_queryform(parsers),5parse_table(parsers),5parse_xml(parsers),5parsers,3,5,5,10prettify,4rawToChar(),10read.
table(),7Request,7,13Response,10,11to_http_date,14unbox,4write.
table(),416

小白云 (80元/月),四川德阳 4核2G,山东枣庄 4核2G,美国VPS20元/月起三网CN2

小白云是一家国人自营的企业IDC,主营国内外VPS,致力于让每一个用户都能轻松、快速、经济地享受高端的服务,成立于2019年,拥有国内大带宽高防御的特点,专注于DDoS/CC等攻击的防护;海外线路精选纯CN2线路,以确保用户体验的首选线路,商家线上多名客服一对一解决处理用户的问题,提供7*24无人全自动化服务。商家承诺绝不超开,以用户体验为中心为用提供服务,一直坚持主打以产品质量用户体验性以及高效...

Nocser:马来西亚独立服务器促销$60.00/月

Nocser刚刚在WHT发布了几款促销服务器,Intel Xeon X3430,8GB内存,1TB HDD,30M不限流量,月付$60.00。Nocser是一家注册于马来西亚的主机商,主要经营虚拟主机、VPS和马来西亚独立服务器业务,数据中心位于马来西亚AIMS机房,线路方面,AIMS到国内电信一般,绕日本NTT;联通和移动比较友好,联通走新加坡,移动走香港,延迟都在100左右。促销马来西亚服务器...

香港E3-1230v2 16GB 30M 326元/月 数脉科技

官方网站:https://www.shuhost.com/公司名:LucidaCloud Limited尊敬的新老客户:艰难的2021年即将结束,年终辞旧迎新之际,我们准备了持续优惠、及首月优惠,为中小企业及个人客户降低IT业务成本。我们将持续努力提供给客户更好的品质与服务,在新的一年期待与您有美好的合作。# 下列价钱首月八折优惠码: 20211280OFF (每客户限用1次) * 自助购买可复制...

404notfound为你推荐
weipin唯品会的唯品钱包里的钱怎么用ghostxp3GHOST系统 ghostxp3 ghostxp2 ghostxp1 三者有什么区别?机械键盘轴机械键盘什么轴好,机械键盘轴有几种虚拟机软件下载谁有好用的虚拟机软件?gbk编码表GB GBK utf8码的区别如何清理ie缓存怎么清理IE的缓存rewritebase为什么我写.htaccess这个 rewriterule 进入死循环了,高手帮忙修改QzongQZONG怎么玩?网站营运网站运营要学些什么?关闭qq相册图标在不删除照片的情况下如何关闭QQ相册图标
php网站空间 万网域名注册 vps安全设置 域名解析服务器 西安服务器 bandwagonhost ix主机 mediafire 外国空间 godaddy优惠券 win8升级win10正式版 权嘉云 秒杀汇 t云 google台湾 什么是web服务器 阿里dns 重庆服务器 北京主机托管 腾讯云平台 更多