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

哪里购买香港云服务器便宜?易探云2核2G低至18元/月起;BGP线路年付低至6.8折

哪里购买香港云服务器便宜?众所周知,国内购买云服务器大多数用户会选择阿里云或腾讯云,但是阿里云香港云服务器不仅平时没有优惠,就连双十一、618、开年采购节这些活动也很少给出优惠。那么,腾讯云虽然海外云有优惠活动,但仅限新用户,购买过腾讯云服务器的用户就不会有优惠了。那么,我们如果想买香港云服务器,怎么样购买香港云服务器便宜和优惠呢?下面,云服务器网(yuntue.com)小编就介绍一下!我们都知道...

美国cera机房 2核4G 19.9元/月 宿主机 E5 2696v2x2 512G

美国特价云服务器 2核4G 19.9元杭州王小玉网络科技有限公司成立于2020是拥有IDC ISP资质的正规公司,这次推荐的美国云服务器也是商家主打产品,有点在于稳定 速度 数据安全。企业级数据安全保障,支持异地灾备,数据安全系数达到了100%安全级别,是国内唯一一家美国云服务器拥有这个安全级别的商家。E5 2696v2x2 2核 4G内存 20G系统盘 10G数据盘 20M带宽 100G流量 1...

HostKvm - 夏季云服务器七折优惠 香港和韩国机房月付5.95美元起

HostKvm,我们很多人都算是比较熟悉的国人服务商,旗下也有多个品牌,差异化多占位策略营销的,商家是一个创建于2013年的品牌,有提供中国香港、美国、日本、新加坡区域虚拟化服务器业务,所有业务均对中国大陆地区线路优化,已经如果做海外线路的话,竞争力不够。今天有看到HostKvm夏季优惠发布,主要针对香港国际和韩国VPS提供7折优惠,折后最低月付5.95美元,其他机房VPS依然是全场8折。第一、夏...

404notfound为你推荐
迅雷不能登录迅雷帐号无法登陆怎么解决?godaddygodaddy域名怎样使用奇虎论坛奇虎问答是什么宕机宕机是什么意思iphone6上市时间苹果6什么时候在中国大陆上市安全漏洞web安全漏洞有哪些安全漏洞什么是安全漏洞攻击??微信电话本怎么用微信电话本短信管理功能怎么用?网页打不开的原因为什么我的有些网页打不开呢?怎样申请支付宝如何申请支付宝?
国内ip代理 论坛虚拟主机 虚拟主机排名 免费主机 外国服务器 174.127.195.202 有益网络 hostloc 1g内存 域名和空间 isp服务商 昆明蜗牛家 根服务器 web服务器是什么 英国伦敦 net空间 ledlamp ssl加速 国外代理服务器 美国主机侦探 更多