Traileracceptencoding

acceptencoding  时间:2021-05-22  阅读:()
HTTPiAbouttheTutorialTheHypertextTransferProtocol(HTTP)isanapplication-levelprotocolfordistributed,collaborative,hypermediainformationsystems.
ThisisthefoundationfordatacommunicationfortheWorldWideWeb(i.
e.
internet)since1990.
HTTPisagenericandstatelessprotocolwhichcanbeusedforotherpurposesaswellusingextensionsofitsrequestmethods,errorcodes,andheaders.
ThistutorialisbasedonRFC-2616specification,whichdefinestheprotocolreferredtoasHTTP/1.
1.
HTTP/1.
1isarevisionoftheoriginalHTTP(HTTP/1.
0).
AmajordifferencebetweenHTTP/1.
0andHTTP/1.
1isthatHTTP/1.
0usesanewconnectionforeachrequest/responseexchange,whereasHTTP/1.
1connectionmaybeusedforoneormorerequest/responseexchanges.
AudienceThistutorialhasbeenpreparedforcomputersciencegraduatesandwebdeveloperstohelpthemunderstandthebasic-to-advancedlevelconceptsrelatedtoHypertextTransferProtocol(HTTP).
PrerequisitesBeforeproceedingwiththistutorial,itisgoodtohaveabasicunderstandingofwebconcepts,webbrowsers,webservers,clientandserverarchitecturebasedsoftwares.
Copyright&DisclaimerCopyright2014byTutorialsPoint(I)Pvt.
Ltd.
Allthecontentandgraphicspublishedinthise-bookarethepropertyofTutorialsPoint(I)Pvt.
Ltd.
Theuserofthise-bookisprohibitedtoreuse,retain,copy,distributeorrepublishanycontentsorapartofcontentsofthise-bookinanymannerwithoutwrittenconsentofthepublisher.
Westrivetoupdatethecontentsofourwebsiteandtutorialsastimelyandaspreciselyaspossible,however,thecontentsmaycontaininaccuraciesorerrors.
TutorialsPoint(I)Pvt.
Ltd.
providesnoguaranteeregardingtheaccuracy,timelinessorcompletenessofourwebsiteoritscontentsincludingthistutorial.
Ifyoudiscoveranyerrorsonourwebsiteorinthistutorial,pleasenotifyusatcontact@tutorialspoint.
comHTTPiiTableofContentsAbouttheTutorialiAudience·iPrerequisites·iCopyright&DisclaimeriTableofContents·ii1.
OVERVIEW·1BasicFeatures·1BasicArchitecture·1Client2Server22.
PARAMETERS3HTTPVersion3UniformResourceIdentifiers3Date/TimeFormats·4CharacterSets·4ContentEncodings4MediaTypes5LanguageTags·53.
MESSAGES·7MessageStart-Line8HeaderFields8MessageBody·94.
REQUESTS10Request-Line·10RequestMethod10HTTPiiiRequest-URI·11RequestHeaderFields12ExamplesofRequestMessage135.
RESPONSES·15MessageStatus-Line15HTTPVersion15StatusCode·16ResponseHeaderFields16ExamplesofResponseMessage·176.
METHODS·19GETMethod·20HEADMethod·20POSTMethod·21PUTMethod·22DELETEMethod·23CONNECTMethod·24OPTIONSMethod·24TRACEMethod·257.
STATUSCODES261xx:Information262xx:Successful·273xx:Redirection·274xx:ClientError285xx:ServerError298.
HEADERFIELDS·31HTTPivGeneralHeaders31Cache-Control·31Connection33Date·34Pragma34Trailer34Transfer-Encoding35Upgrade·35Via·35Warning·35ClientRequestHeaders·36Accept·36Accept-Charset·36Accept-Encoding·36Accept-Language·37Authorization·37Cookie·37Expect·38From38Host38If-Match·38If-Modified-Since·39If-None-Match·39If-Range40If-Unmodified-Since40Max-Forwards40Proxy-Authorization41Range·41Referer·42TE·42User-Agent42ServerResponseHeaders·43Accept-Ranges·43Age·43ETag·43Location·44Proxy-Authenticate44Retry-After·44Server45Set-Cookie45Vary46WWW-Authenticate·46EntityHeaders47Allow·47Content-Encoding·47Content-Language47Content-Length48HTTPvContent-Location·48Content-MD5·48Content-Range49Content-Type·49Expires50Last-Modified509.
CACHING·5110.
URLENCODING·5411.
SECURITY·60PersonalInformationLeakage60FileandPathNamesBasedAttack·60DNSSpoofing61LocationHeadersandSpoofing·61AuthenticationCredentials61ProxiesandCaching·6112.
MESSAGEEXAMPLES·62Example162Clientrequest62Serverresponse·62Example263Clientrequest63Serverresponse·63Example364Clientrequest64Serverresponse·64Example465Clientrequest65Serverresponse·65HTTP1TheHypertextTransferProtocol(HTTP)isanapplication-levelprotocolfordistributed,collaborative,hypermediainformationsystems.
ThisisthefoundationfordatacommunicationfortheWorldWideWeb(i.
e.
internet)since1990.
HTTPisagenericandstatelessprotocolwhichcanbeusedforotherpurposesaswellusingextensionsofitsrequestmethods,errorcodes,andheaders.
Basically,HTTPisaTCP/IPbasedcommunicationprotocolthatisusedtodeliverdata(HTMLfiles,imagefiles,queryresults,etc.
)ontheWorldWideWeb.
ThedefaultportisTCP80,butotherportscanbeusedaswell.
Itprovidesastandardizedwayforcomputerstocommunicatewitheachother.
HTTPspecificationspecifieshowclients'requestdatawillbeconstructedandsenttotheserver,andhowtheserversrespondtotheserequests.
BasicFeaturesTherearethreebasicfeaturesthatmakeHTTPasimplebutpowerfulprotocol:HTTPisconnectionless:TheHTTPclient,i.
e.
,abrowserinitiatesanHTTPrequestandafterarequestismade,theclientdisconnectsfromtheserverandwaitsforaresponse.
Theserverprocessestherequestandre-establishestheconnectionwiththeclienttosendaresponseback.
HTTPismediaindependent:Itmeans,anytypeofdatacanbesentbyHTTPaslongasboththeclientandtheserverknowhowtohandlethedatacontent.
ItisrequiredfortheclientaswellastheservertospecifythecontenttypeusingappropriateMIME-type.
HTTPisstateless:Asmentionedabove,HTTPisconnectionlessanditisadirectresultofHTTPbeingastatelessprotocol.
Theserverandclientareawareofeachotheronlyduringacurrentrequest.
Afterwards,bothofthemforgetabouteachother.
Duetothisnatureoftheprotocol,neithertheclientnorthebrowsercanretaininformationbetweendifferentrequestsacrossthewebpages.
HTTP/1.
0usesanewconnectionforeachrequest/responseexchange,whereasHTTP/1.
1connectionmaybeusedforoneormorerequest/responseexchanges.
BasicArchitectureThefollowingdiagramshowsaverybasicarchitectureofawebapplicationanddepictswhereHTTPsits:1.
OVERVIEWHTTP2TheHTTPprotocolisarequest/responseprotocolbasedontheclient/serverbasedarchitecturewherewebbrowsers,robotsandsearchengines,etc.
actlikeHTTPclients,andtheWebserveractsasaserver.
ClientTheHTTPclientsendsarequesttotheserverintheformofarequestmethod,URI,andprotocolversion,followedbyaMIME-likemessagecontainingrequestmodifiers,clientinformation,andpossiblebodycontentoveraTCP/IPconnection.
ServerTheHTTPserverrespondswithastatusline,includingthemessage'sprotocolversionandasuccessorerrorcode,followedbyaMIME-likemessagecontainingserverinformation,entitymeta-information,andpossibleentity-bodycontent.
HTTP3ThischapterisgoingtolistdownfewoftheimportantHTTPProtocolParametersandtheirsyntaxthewaytheyareusedinthecommunication.
Forexample,formatfordate,formatofURL,etc.
ThiswillhelpyouinconstructingyourrequestandresponsemessageswhilewritingHTTPclientorserverprograms.
YouwillseethecompleteusageoftheseparametersinsubsequentchapterswhilelearningthemessagestructureforHTTPrequestsandresponses.
HTTPVersionHTTPusesa.
numberingschemetoindicateversionsoftheprotocol.
TheversionofanHTTPmessageisindicatedbyanHTTP-Versionfieldinthefirstline.
HereisthegeneralsyntaxofspecifyingHTTPversionnumber:HTTP-Version="HTTP""/"1*DIGIT".
"1*DIGITExampleHTTP/1.
0orHTTP/1.
1UniformResourceIdentifiersUniformResourceIdentifiers(URI)aresimplyformatted,case-insensitivestringcontainingname,location,etc.
toidentifyaresource,forexample,awebsite,awebservice,etc.
AgeneralsyntaxofURIusedforHTTPisasfollows:URI="http:""//"host[":"port][abs_path[""query]]Hereiftheportisemptyornotgiven,port80isassumedforHTTPandanemptyabs_pathisequivalenttoanabs_pathof"/".
Thecharactersotherthanthoseinthereservedandunsafesetsareequivalenttotheir""%"HEXHEX"encoding.
2.
PARAMETERSHTTP4ExampleThefollowingthreeURIsareequivalent:http://abc.
com:80/~smith/home.
htmlhttp://ABC.
com/%7Esmith/home.
htmlhttp://ABC.
com:/%7esmith/home.
htmlDate/TimeFormatsAllHTTPdate/timestampsMUSTberepresentedinGreenwichMeanTime(GMT),withoutexception.
HTTPapplicationsareallowedtouseanyofthefollowingthreerepresentationsofdate/timestamps:Sun,06Nov199408:49:37GMT;RFC822,updatedbyRFC1123Sunday,06-Nov-9408:49:37GMT;RFC850,obsoletedbyRFC1036SunNov608:49:371994;ANSIC'sasctime()formatCharacterSetsWeusecharactersetstospecifythecharactersetsthattheclientprefers.
Multiplecharactersetscanbelistedseparatedbycommas.
Ifavalueisnotspecified,thedefaultistheUS-ASCII.
ExampleFollowingarethevalidcharactersets:US-ASCIIorISO-8859-1orHTTP5ISO-8859-7ContentEncodingsAcontentencodingvalueindicatesthatanencodingalgorithmhasbeenusedtoencodethecontentbeforepassingitoverthenetwork.
Contentcodingareprimarilyusedtoallowadocumenttobecompressedorotherwiseusefullytransformedwithoutlosingtheidentity.
Allcontent-codingvaluesarecase-insensitive.
HTTP/1.
1usescontent-codingvaluesintheAccept-EncodingandContent-Encodingheaderfieldswhichwewillseeinthesubsequentchapters.
ExampleFollowingarethevalidencodingschemes:Accept-encoding:gziporAccept-encoding:compressorAccept-encoding:deflateMediaTypesHTTPusesInternetMediaTypesintheContent-TypeandAcceptheaderfieldsinordertoprovideopenandextensibledatatypingandtypenegotiation.
AlltheMedia-typevaluesareregisteredwiththeInternetAssignedNumberAuthority(IANA).
Thegeneralsyntaxtospecifymediatypeisasfollows:media-type=type"/"subtype*(";"parameter)Thetype,subtype,andparameterattributenamesarecase-insensitive.
HTTP6ExampleAccept:image/gifLanguageTagsHTTPuseslanguagetagswithintheAccept-LanguageandContent-Languagefields.
Alanguagetagiscomposedofoneormoreparts:aprimarylanguagetagandapossiblyemptyseriesofsubtags:language-tag=primary-tag*("-"subtag)Whitespacesarenotallowedwithinthetagsandalltagsarecase-insensitive.
ExampleExampletagsinclude:en,en-US,en-cockney,i-cherokee,x-pig-latinwhereanytwo-letterprimary-tagisanISO-639languageabbreviationandanytwo-letterinitialsubtagisanISO-3166countrycode.
HTTP7HTTPisbasedontheclient-serverarchitecturemodelandastatelessrequest/responseprotocolthatoperatesbyexchangingmessagesacrossareliableTCP/IPconnection.
AnHTTP"client"isaprogram(Webbrowseroranyotherclient)thatestablishesaconnectiontoaserverforthepurposeofsendingoneormoreHTTPrequestmessages.
AnHTTP"server"isaprogram(generallyawebserverlikeApacheWebServerorInternetInformationServicesIIS,etc.
)thatacceptsconnectionsinordertoserveHTTPrequestsbysendingHTTPresponsemessages.
HTTPmakesuseoftheUniformResourceIdentifier(URI)toidentifyagivenresourceandtoestablishaconnection.
Oncetheconnectionisestablished,HTTPmessagesarepassedinaformatsimilartothatusedbytheInternetmail[RFC5322]andtheMultipurposeInternetMailExtensions(MIME)[RFC2045].
Thesemessagesincluderequestsfromclienttoserverandresponsesfromservertoclientwhichwillhavethefollowingformat:HTTP-message=|;HTTP/1.
1messagesHTTPrequestsandHTTPresponsesuseagenericmessageformatofRFC822fortransferringtherequireddata.
Thisgenericmessageformatconsistsofthefollowingfouritems.
AStart-lineZeroormoreheaderfieldsfollowedbyCRLFAnemptyline(i.
e.
,alinewithnothingprecedingtheCRLF)indicatingtheendoftheheaderfieldsOptionallyamessage-bodyInthefollowingsections,wewillexplaineachoftheentitiesusedinanHTTPmessage.
3.
MESSAGESHTTP8MessageStart-LineAstart-linewillhavethefollowinggenericsyntax:start-line=Request-Line|Status-LineWewilldiscussRequest-LineandStatus-LinewhilediscussingHTTPRequestandHTTPResponsemessagesrespectively.
Fornow,let'sseetheexamplesofstartlineincaseofrequestandresponse:GET/hello.
htmHTTP/1.
1(ThisisRequest-Linesentbytheclient)HTTP/1.
1200OK(ThisisStatus-Linesentbytheserver)HeaderFieldsHTTPheaderfieldsproviderequiredinformationabouttherequestorresponse,orabouttheobjectsentinthemessagebody.
TherearefourtypesofHTTPmessageheaders:General-header:Theseheaderfieldshavegeneralapplicabilityforbothrequestandresponsemessages.
Request-header:Theseheaderfieldshaveapplicabilityonlyforrequestmessages.
Response-header:Theseheaderfieldshaveapplicabilityonlyforresponsemessages.
Entity-header:Theseheaderfieldsdefinemeta-informationabouttheentity-bodyor,ifnobodyispresent,abouttheresourceidentifiedbytherequest.
Alltheabove-mentionedheadersfollowthesamegenericformatandeachoftheheaderfieldconsistsofanamefollowedbyacolon(:)andthefieldvalueasfollows:message-header=field-name":"[field-value]Followingaretheexamplesofvariousheaderfields:User-Agent:curl/7.
16.
3libcurl/7.
16.
3OpenSSL/0.
9.
7lzlib/1.
2.
3Host:www.
example.
comAccept-Language:en,miDate:Mon,27Jul200912:28:53GMTHTTP9Server:ApacheLast-Modified:Wed,22Jul200919:15:56GMTETag:"34aa387-d-1568eb00"Accept-Ranges:bytesContent-Length:51Vary:Accept-EncodingContent-Type:text/plainMessageBodyThemessagebodypartisoptionalforanHTTPmessagebutifitisavailable,thenitisusedtocarrytheentity-bodyassociatedwiththerequestorresponse.
Ifentitybodyisassociated,thenusuallyContent-TypeandContent-Lengthheaderslinesspecifythenatureofthebodyassociated.
AmessagebodyistheonewhichcarriestheactualHTTPrequestdata(includingformdataanduploaded,etc.
)andHTTPresponsedatafromtheserver(includingfiles,images,etc.
).
Shownbelowisthesimplecontentofamessagebody:Hello,World!
HTTP10AnHTTPclientsendsanHTTPrequesttoaserverintheformofarequestmessagewhichincludesthefollowingformat:ARequest-lineZeroormoreheader(General|Request|Entity)fieldsfollowedbyCRLFAnemptyline(i.
e.
,alinewithnothingprecedingtheCRLF)indicatingtheendoftheheaderfieldsOptionallyamessage-bodyThefollowingsectionsexplaineachoftheentitiesusedinanHTTPrequestmessage.
Request-LineTheRequest-Linebeginswithamethodtoken,followedbytheRequest-URIandtheprotocolversion,andendingwithCRLF.
TheelementsareseparatedbyspaceSPcharacters.
Request-Line=MethodSPRequest-URISPHTTP-VersionCRLFLet'sdiscusseachofthepartsmentionedintheRequest-Line.
RequestMethodTherequestmethodindicatesthemethodtobeperformedontheresourceidentifiedbythegivenRequest-URI.
Themethodiscase-sensitiveandshouldalwaysbementionedinuppercase.
ThefollowingtablelistsallthesupportedmethodsinHTTP/1.
1.
4.
REQUESTSHTTP11EndofebookpreviewIfyoulikedwhatyousaw…Buyitfromourstore@https://store.
tutorialspoint.
com

PhotonVPS:$4/月,KVM-2GB/30GB/2TB/洛杉矶&达拉斯&芝加哥等

很久没有分享PhotonVPS的消息,最近看到商家VPS主机套餐有一些更新所以分享下。这是一家成立于2008年的国外VPS服务商,Psychz机房旗下的站点,主要提供VPS和独立服务器等,数据中心包括美国洛杉矶、达拉斯、芝加哥、阿什本等。目前,商家针对Cloud VPS提供8折优惠码,优惠后最低2G内存套餐每月4美元起。下面列出几款主机配置信息。CPU:1core内存:2GB硬盘:30GB NVm...

易探云香港云服务器价格多少钱1个月/1年?

易探云怎么样?易探云是目前国内少数优质的香港云服务器服务商家,目前推出多个香港机房的香港云服务器,有新界、九龙、沙田、葵湾等机房,还提供CN2、BGP及CN2三网直连香港云服务器。近年来,许多企业外贸出海会选择香港云服务器来部署自己的外贸网站,使得越来越多的用户会选择易探云作为网站服务提供平台。今天,云服务器网(yuntue.com)小编来谈谈易探云和易探云服务器怎么样?具体香港云服务器多少钱1个...

spinservers($179/月),1Gbps不限流量服务器,双E5-2630Lv3/64GB/1.6T SSD/圣何塞机房

中秋节快到了,spinservers针对中国用户准备了几款圣何塞机房特别独立服务器,大家知道这家服务器都是高配,这次推出的机器除了配置高以外,默认1Gbps不限制流量,解除了常规机器10TB/月的流量限制,价格每月179美元起,机器自动化上架,一般30分钟内,有基本自助管理功能,带IPMI,支持安装Windows或者Linux操作系统。配置一 $179/月CPU:Dual Intel Xeon E...

acceptencoding为你推荐
在B2B的登录首页下方,点击账号密码查询连接参考手册NDXS和ND5XS网络音频播放器中文目录usergoogle支持ipadwin7关闭445端口如何快速关闭445端口ipad连不上wifiipad无法加入网络怎么回事勒索病毒win7补丁我的电脑是windows7系统,为什么打不了针对勒索病毒的补丁(杀毒软件显iphone连不上wifi苹果手机为什么突然连不上家里的wifi?ms17-010win10pybaen.10.的硬币是哪国的再中国至多少钱googleadsense如何通过Google adsense???
tk域名注册 域名查询工具 中国域名交易中心 互联网域名管理办法 net主机 漂亮qq空间 10t等于多少g 万网优惠券 嘟牛 韩国网名大全 合租空间 cdn联盟 老左正传 免费防火墙 双11秒杀 91vps 中国电信测网速 vip购优惠 支付宝扫码领红包 香港新世界中心 更多