英文:
"Content-Type" for HEAD request
问题
应该在 HEAD 请求中提供的 "Content-Type" 参数是空值。
英文:
I'm building a REST API. Before calling a GET endpoint a HEAD request should be sent.
What kind of "Content-Type" parameter should a HEAD request provide?
答案1
得分: 0
不强制在发送GET请求之前发送HEAD请求。 <br/> HTTP HEAD方法请求的是如果使用HTTP GET方法而不是HTTP HEAD方法请求HEAD请求的URL时将返回的标头。HEAD请求/响应没有正文,因此不需要Content-Type标头。
英文:
Its not mandatory to send HEAD
request before sending GET
request. <br/> The HTTP HEAD
method requests the headers that would be returned if the HEAD
request's URL was instead requested with the HTTP GET
method. HEAD
request/response have no body so there is no need of Content-Type header
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论