HTTP Request GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE Methods

An HTTP request is a class consisting of HTTP style requests, request lines, request methods, request URL, header fields, and body content. The most common methods that are used by a client in an HTTP request are as follows:-

1) GET:- Used when the client is requesting a resource on the Web server.

2) HEAD:- Used when the client is requesting some information about a resource but not requesting the resource itself.

3) POST:- Used when the client is sending information or data to the server—for example, filling out an online form (i.e. Sends a large amount of complex data to the Web Server).

4) PUT:- Used when the client is sending a replacement document or uploading a new document to the Web server under the request URL.

5) DELETE:- Used when the client is trying to delete a document from the Web server, identified by the request URL.

6) TRACE:- Used when the client is asking the available proxies or intermediate servers changing the request to announce themselves.

7) OPTIONS:- Used when the client wants to determine other available methods to retrieve or process a document on the Web server. 

8) CONNECT:- Used when the client wants to establish a transparent connection to a remote host, usually to facilitate SSL-encrypted communication (HTTPS) through an HTTP proxy.

The GET Request Method

The GET method is the simplest and the most frequently used request method. It is used to access the static resources, such as HTML documents and images. GET request can be used to retrieve dynamic information by including query parameters in the request URL. For instance, we can send a parameter name with the URL, such as http://www.domain.com?name=Harsh. In this example, Harsh is the dynamic information sent by including a parameter,name, in the request URL. The Web Server can then access this dynamic information through the “name” parameter.

The HEAD Request Method

According to Wikipedia “Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.” It is used when the client is requesting some information about a resource but not requesting the resource itself. This means that we have a faster way of checking the headers and some server info for a given resource on the server i.e. checking if a given url is serviceable, a given file exists, etc..Sometimes client might only need to view the header of a response (Content-Type or Content-Length). The client can use the HEAD request method to retrieve the header in such cases. The HEAD method is similar to GET method, except that the server does not return a message body (actual page) in response of the HEAD method.

The POST Request Method

The Post method is commonly used for accessing dynamic resources or when a large amount of complex information is to be sent to the server. The Web Server accepts the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI( Uniform Resource Identifier). According to Wikipedia “Submits data to be processed (e.g., from an HTML form) to the identified resource. The data is included in the body of the request. This may result in the creation of a new resource or the updates of existing resources or both.” The major difference between GET and POST is that in GET the request parameters are transmitted as a query string appended to the request URL, while in POST the request parameters are transmitted within the body of the request.
The POST request method provides the following functionalities:-
1) Providing annotations of the existing resources.
2) Posting a message to a bulletin board, newsgroup, mailing list, or a similar group of articles.
3) Providing a block of data, such as the result of the submitting a form, to a data-handling process.
4) Extending a database through an append operation.

The PUT Request method

The PUT method stores an entity in the specified Request-URI. The entity is a resource residing on the Web server under the specified Request-URI. If the Request-URI does not point to an existing resource, but is capable of being defined as a new resource by the requesting user, the Web Server can create the resource with that URI. If an existing resource is modified, either the 200(OK) or 204 (No Content) response code should be sent to indicate successful modification of a resource. The Web Server must inform the user via the 201 (Created) responses if a new resource is created. If the resource is not created or modified with the Request-URI, an appropriate error response is generated, which reflects the nature of the problem.

The DELETE Request method

The DELETE method requests the Web server to delete the resource identified by the Request-URI. This method may be overridden by human intervention (or other means) on the Web Server. If the response includes an entity describing the status of deletion, the 200(OK) response code specifies that the resource has been deleted successfully. If the response is 202(Accepted), it specifies that the resource has not yet been deleted. Similarly, if the response code is 204 ( No Content), it specifies that the resource has been deleted but the response code does not include an entity.

The OPTIONS Request method

According to Wikipedia “Returns the HTTP methods that the server supports for specified URL. This can be used to check the functionality of a web server by requesting '*' instead of a specific resource.”
The OPTION method requests for information about the communication options available on the request/response chain identified by a Request-URI. Responses to this method are not cacheable. This method allows the client to determine the options and /or requirements associated with a resource, or the capabilities of a server. If the OPTIONS method includes an entity body, the media type must be indicated by the content-type field.

The TRACE Request method

According to Wikipedia “Echoes back the received request, so that a client can see what (if any) changes or additions have been made by intermediate servers.”
The TRACE method is used to invoke a remote application layer associated with a request message. A TRACE request must not include an entity. A client uses the TRACE method to see the received input at the other end of the request chain and diagnostic or testing information.

数电实训:万年历 万年历 阅读详情

相关推荐

基于Python的信用卡欺诈检测机器学习案例报告

当今时代,在线支付已成为一种高效便捷的支付方式,我们可以突破时间和空间的限制,输入我们的信用卡各项信息就可以完成在线支付。但随之而来的是这种支付方式也具备一定的风险性,我们无法辨别对方是否是恶意套取我们资金的非法分子。当信用卡信息数据泄露导致金钱失窃并最终失去客户忠诚度和公司声誉时,组织、消费者、银行和商家都会面临风险。2017 年,未经授权的信用卡操作达到了惊人的 1670 万受害者。此外,据美国联邦贸易委员会 (FTC) 报告,2017 年信用卡欺诈索赔数量比上一年高出 40%。

weixin_45673389的博客 6697

HttpWebRequest使用HEAD方法获取远程文件大小

HTTP使用HEAD方法请求时,服务器只返回HTTP报头,不返回文档主体,因而可以用它来获取远程文件大小: string url = "http://www.mzwu.com/test.apk"; HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = "HEAD"; HttpW...

ASP.NET 2235

别再自己写组件了!用uni-app的midButton属性5分钟搞定中间凸起TabBar(H5/小程序通用)

本文详细介绍了uni-app官方提供的midButton属性,帮助开发者5分钟内实现中间凸起的TabBar效果,无需编写繁琐的自定义组件代码。该方案兼容H5和微信小程序平台,配置简单且维护成本低,大幅提升开发效率和性能表现。

weixin_30431445的博客 348

关于解决Request method 'HEAD' not supported

该异常一般是在线上生产环境中产生的请求异常。 产生该异常的缘由: 实际生产中的head请求一般由搜索引擎发出。 搜索引擎先发送HEAD 请求是为了获得页面的更新时间(即response header 中的Last-Modified 域), 用于判断自从上一次该页面被收入索引库以后有没有被更新过,如果判断页面没有被更新过就忽略该页面, 否则就再用GET 方法获取一次最新的内容并更新到索引...

wangjiao121的专栏 6398

无监督学习初探:K-Means聚类与主成分分析(PCA)

K-Means适用于快速分组,但对数据分布敏感,可结合轮廓系数评估质量。PCA通过特征值分解实现线性降维,需注意非线性场景的替代方案(如UMAP)。进阶方向:聚类:谱聚类、高斯混合模型(GMM)处理复杂形状。降维:t-SNE、自编码器处理非线性结构。

weixin_69882801的博客 1454

深入解析MSPM0系列Keil开发中‘ti_msp_dl_config.h‘缺失问题的根源与修复

本文深入解析TI MSPM0系列Keil开发中'ti_msp_dl_config.h'文件缺失问题的根源与修复方法。该错误常见于编译时提示file not found,主要因SysConfig工具未正确生成或工程路径配置错误导致。文章提供了从环境检查、手动生成文件到工程配置调整的系统化解决方案,帮助开发者快速解决这一常见KEIL开发难题。

gold的博客 971

RequestMethod的参数的含义是?

RequestMethod为请求的类型,比如是HTTP的GET请求还是POST请求等,HTTP请求枚举取值范围为:GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS,TRACE,常用的是GET和POST请求。 GET(SELECT):从服务器查询,可以在服务器通过请求的参数区分查询的方式。 POST(CREATE):在服务器新建一个资源,调用insert操作。 PUT...

乔治大哥的博客 8608

告别兼容性困扰:在F-Droid中安全部署Termux的完整指南

本文提供了一份在F-Droid中安全部署Termux的完整指南,旨在彻底解决Android设备上的兼容性困扰。文章详细阐述了为何选择F-Droid而非Google Play商店,并逐步指导用户完成从彻底清理旧版本、安装F-Droid客户端、授予权限到最终安装配置Termux的全过程。指南还涵盖了进阶的稳定性配置、数据迁移方法以及常见问题排查,确保用户获得一个稳定、无冲突的命令行工作环境。

weixin_29224309的博客 950

HTTP Request 常用方法GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE

1) GET:- Used when the client is requesting a resource on the Web server.     当客户端向Web服务器请求一个资源的时候使用。 2) HEAD:- Used when the client is requesting some information about a resource but not requesting the resource itself.     当客户端向Web服务器请求一个资源的一些信息而不是资源

执 3440

Mask2former自定义数据集实现滑坡语义分割

先介绍一下这次用的数据集:Bijie Landslide Dataset,是武汉大学在Triplesat卫星上裁剪的数据集,包含770张滑坡(image、mask、dem、边界坐标txt)和2003张非滑坡数据(dem、image)。直接在ade20k修改,按照路径和设置将预处理数据放好,该步骤很快就能结束,打开的图片是全黑的,因为0和1在图片上肉眼较难区分。bijie的数据集可以直接使用,接下去的步骤是1、预处理数据。配置文件修改训练类别和训练类型,由于我们分割的是滑坡,所以进行语义分割。

weixin_57812838的博客 2217

阿里开源最强数字人工具 EchoMimicV2,本地部署(一)

EchoMimicV2是阿里推出的半身人体AI数字人项目,基于参考图片、音频剪辑和手部姿势序列生成高质量动画视频,确保音频内容与半身动作的一致性。现在本地部署,安装体验一下。

缘分天空的专栏 4621

Java常见HTTP请求方法RequestMethod

大部分内容来源于此spring中常见的http请求访问方法:public enum RequestMethod { GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE}如: @RequestMapping(value = “/new”, method = RequestMethod.GET)各个请求方法的使用场景 GET 平时网页的一些基本的

there_is_nothing的博客 2万+

PRPD图谱分析从入门到精通:5种典型放电模式的识别手册

本文详细解析PRPD图谱分析技术,重点介绍电晕放电、悬浮放电等5种典型放电模式的识别方法。通过37组真实案例对比,提供关键识别区和诊断流程图模板,帮助工程师快速掌握变电站设备状态监测的核心技能,提升绝缘缺陷诊断准确率。

weixin_29214199的博客 476

HTTP OPTIONS方法安全风险深度解析与Nginx、Apache、Spring Boot修复实战

HTTP协议定义了多种请求方法,其中OPTIONS方法用于查询服务器支持的通信选项。从安全视角看,非必要的HTTP方法开放会扩大攻击面,攻击者可利用OPTIONS探测服务器支持的PUT、DELETE等危险方法,进而实施针对性攻击。遵循最小权限原则,应在保证业务正常的前提下严格限制HTTP方法访问。对于现代Web应用,需特别注意CORS(跨域资源共享)场景中OPTIONS预检请求的合法需求,避免一刀切禁用导致功能故障。本文聚焦OPTIONS方法引发的信息泄露风险,提供覆盖Nginx、Apache及Spring

weixin_33735077的博客 442

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ByteByteGo-Top 9 HTTP Request Methods 9种HTTP请求方法

具有幂等性(idempotent),多次同样的Requests则得到同样的结果。具有幂等性(idempotent),多次同样的Requests删除一样的资源。具有幂等性(idempotent),多次同样的Reqests修改一样的资源。CONNECT方法建立到由目标资源标识的服务器的通道(tunnel)。这将沿目标资源的路径执行消息环回(loop-back)测试。不具有幂等姓(idempotent),造成重复创建资源。HEAD方法要求一个与GET请求相同但没有响应体的响应。描述了目标资源的通信选项。

DachuiLi的博客 476

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

HTTP 方法安全性与幂等性深度解析:5 种常见误用场景与修复方案

本文深入解析HTTP方法的安全性与幂等性,详细剖析GET、POST、PUT等方法的5种常见误用场景,并提供具体修复方案。通过规范API设计,确保系统可靠性,避免因方法误用导致的数据不一致和安全风险,帮助开发者构建更健壮的分布式系统。

benben 449

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

Common HTTP Response Codes & HTTP Request Methods

Common HTTP Response Codes: Code Description 200 OK This response code is returned if the document or file in question is found and served correctly. 304 Not Modified

guolibin的专栏 610

HTTP/1.1 9 种请求方法实战:从 CRUD 到 RESTful API 设计的 3 个关键映射

本文深入解析HTTP/1.1的9种请求方法,特别是GET、POST、PUT等核心方法在CRUD操作与RESTful API设计中的实战应用。通过三层映射关系和状态码使用指南,帮助开发者构建规范、高效的API接口,提升Web应用的可维护性和清晰度。

weixin_30892763的博客 412

Pyramid中Request Methods与DBSession的协同机制解析

Web框架中的请求方法(HTTP Method)是资源操作语义的标准化入口,其本质是将客户端意图映射为服务端可执行的控制流;而数据库会话(DBSession)则承担着事务边界管理、数据一致性保障与上下文感知写入的核心职责。二者协同构建了‘请求-事务-资源’的黄金三角:方法决定操作类型(如GET只读、POST写入),会话据此自动适配事务行为(如禁用提交或启用保存点)。这种设计显著提升API健壮性、审计合规性与高并发下的事务稳定性,广泛应用于金融风控、多端统一后台等强一致性场景。本文深入剖析Pyramid框架中

weixin_30617737的博客 563
上一篇: Content-Type
下一篇: Problems During Content Assist Eclipse代码提示错误,代码助手出错
tempdowncomputer
博客等级 码龄16年 2粉丝 405原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值