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

腾讯云轻量服务器老用户续费优惠和老用户复购活动

继阿里云服务商推出轻量服务器后,腾讯云这两年对于轻量服务器的推广力度还是比较大的。实际上对于我们大部分网友用户来说,轻量服务器对于我们网站和一般的业务来说是绝对够用的。反而有些时候轻量服务器的带宽比CVM云服务器够大,配置也够好,更有是价格也便宜,所以对于初期的网站业务来说轻量服务器是够用的。这几天UCLOUD优刻得香港服务器稳定性不佳,于是有网友也在考虑搬迁到腾讯云服务器商家,对于轻量服务器官方...

SpinServers(月89美元) 2*e5-2630L v2,美国独立服务器

SpinServers服务商也不算是老牌的服务商,商家看介绍是是2018年成立的主机品牌,隶属于Majestic Hosting Solutions LLC旗下。商家主要经营独立服务器租用和Hybrid Dedicated服务器等,目前包含的数据中心在美国达拉斯、圣何塞机房,自有硬件和IP资源等,商家还自定义支持用户IP广播到机房。看到SpinServers推出了美国独服的夏季优惠促销活动,最低月...

wordpress专业外贸建站主题 WordPress专业外贸企业网站搭建模版

WordPress专业外贸企业网站搭建模版,特色专业外贸企业风格 + 自适应网站开发设计 通用流行的外贸企业网站模块 + 更好的SEO搜索优化和收录 自定义多模块的产品展示功能 + 高效实用的后台自定义模块设置!采用标准的HTML5+CSS3语言开发,兼容当下的各种主流浏览器: IE 6+(以及类似360、遨游等基于IE内核的)、Firefox、Google Chrome、Safari、Opera...

acceptencoding为你推荐
contentgoogle流量支付宝netbios端口怎么关闭8909端口!其他端口就不用了iexplore.exe应用程序错误iexplore.exe应用程序错误win10445端口windows server2008怎么开放4443端口itunes备份itunes就是备份不了怎么办啊googleadsense10分钟申请Google Adsense是一种怎样的体验ipad无法加入网络为什么ipad无法加入网络?chrome18怎么关闭chrome的自动更新,稳定版要18了,mactype要悲剧了winrar5.0winrar压缩3种格式分别有什么区别
美国服务器托管 域名注册godaddy 网站虚拟主机空间 俄罗斯vps 东莞电信局 荣耀欧洲 uk2 优key 华为网络硬盘 e蜗 北京双线机房 admit的用法 新家坡 vip域名 网游服务器 免费网页申请 江苏双线服务器 vul 我的世界服务器ip 东莞服务器托管 更多