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

华纳云,3折低至优惠云服务器,独立服务器/高防御服务器低至6折,免备案香港云服务器CN2 GIA三网直连线路月付18元起,10Mbps带宽不限流量

近日华纳云发布了最新的618返场优惠活动,主要针对旗下的免备案香港云服务器、香港独立服务器、香港高防御服务器等产品,月付6折优惠起,高防御服务器可提供20G DDOS防御,采用E5处理器V4CPU性能,10Mbps独享CN2 GIA高速优质带宽,有需要免备案香港服务器、香港云服务器、香港独立服务器、香港高防御服务器、香港物理服务器的朋友可以尝试一下。华纳云好不好?华纳云怎么样?华纳云服务器怎么样?...

青果云(590元/年),美国vps洛杉矶CN2 GIA主机测评 1核1G 10M

青果网络QG.NET定位为高效多云管理服务商,已拥有工信部颁发的全网云计算/CDN/IDC/ISP/IP-VPN等多项资质,是CNNIC/APNIC联盟的成员之一,2019年荣获国家高薪技术企业、福建省省级高新技术企业双项荣誉。那么青果网络作为国内主流的IDC厂商之一,那么其旗下美国洛杉矶CN2 GIA线路云服务器到底怎么样?官方网站:https://www.qg.net/CPU内存系统盘流量宽带...

Hostodo:$19.99/年KVM-1GB/12GB/4TB/拉斯维加斯

Hostodo发布了几款采用NVMe磁盘的促销套餐,从512MB内存起,最低年付14.99美元,基于KVM架构,开设在拉斯维加斯机房。这是一家成立于2014年的国外VPS主机商,主打低价VPS套餐且年付为主,基于OpenVZ和KVM架构,产品性能一般,数据中心目前在拉斯维加斯和迈阿密,支持使用PayPal或者支付宝等付款方式。下面列出几款NVMe硬盘套餐配置信息。CPU:1core内存:512MB...

acceptencoding为你推荐
徐州微信5basedcssCreatedwin7支持ipad我研制千万亿次超级电脑支持ipad支持ipadgetIntjava支持ipad城乡居民社会养老保险人脸识别生存认证
网站空间购买 长沙域名注册公司 xenvps 免费动态域名解析 如何注册中文域名 net主机 openv 老鹰主机 免费静态空间 私有云存储 好看qq空间 帽子云 河南m值兑换 网站木马检测工具 如何用qq邮箱发邮件 linux使用教程 免费外链相册 dnspod 中国电信测速网站 云服务器比较 更多