HEAD
Check file metadata
HEAD
/version-2.0.1.zip
HTTP/1.1
Accept: */*
Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
User-Agent: rest-man/1.1.0 (darwin21 arm64) ruby/3.1.2p20
Host: example.com
HTTP/1.1
200
OK
Date: Fri, 25 Aug 2023 17:22:33 GMT
Last-Modified: Wed, 23 Aug 2023 11:41:12 GMT
Content-Type: application/zip
Content-Length: 10338267
response = RestMan.head "http://example.com/version-2.0.1.zip"
response.code #=>200
response.headers #=> Hash
response.headers[:date] #=> Fri, 25 Aug 2023 17:22:33 GMT
response.headers[:last_modified] #=> Wed, 23 Aug 2023 11:41:12 GMT
response.headers[:content_type] #=> application/zip
response.headers[:content_length] #=> 10338267
response = RestMan::Request.execute(
method: :get,
url: "http://example.com/version-2.0.1.zip"
)
response.code #=>200
response.headers #=> Hash
response.headers[:date] #=> Fri, 25 Aug 2023 17:22:33 GMT
response.headers[:last_modified] #=> Wed, 23 Aug 2023 11:41:12 GMT
response.headers[:content_type] #=> application/zip
response.headers[:content_length] #=> 10338267
resource = RestMan::Resource.new("http://example.com/version-2.0.1.zip")
resposne = resource.head
response.code #=>200
response.headers #=> Hash
response.headers[:date] #=> Fri, 25 Aug 2023 17:22:33 GMT
response.headers[:last_modified] #=> Wed, 23 Aug 2023 11:41:12 GMT
response.headers[:content_type] #=> application/zip
response.headers[:content_length] #=> 10338267
RestMan CLI hasn't support head request.
Verifying Availability of a video streaming resource
HEAD
/video/1.mp4
HTTP/1.1
Accept: */*
Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
User-Agent: rest-man/1.1.0 (darwin21 arm64) ruby/3.1.2p20
Host: example.com
X-Api-Key: api-key-abc
HTTP/1.1
200
OK
Date: Fri, 25 Aug 2023 17:22:33 GMT
Last-Modified: Wed, 23 Aug 2023 11:41:12 GMT
Content-Type: video/mp4
Accept-Range: bytes
Content-Length: 10338267
response = RestMan.head "http://example.com/video/1.mp4", { "X-API-Key": "api-key-abc" }
response.code #=>200
response.headers #=> Hash
response.headers[:date] #=> Fri, 25 Aug 2023 17:22:33 GMT
response.headers[:last_modified] #=> Wed, 23 Aug 2023 11:41:12 GMT
response.headers[:content_type] #=> video/mp4
response.headers[:accept_range] #=> bytes
response.headers[:content_length] #=> 10338267
response = RestMan::Request.execute(
method: :get,
url: "http://example.com/video/1.mp4",
headers: {
"X-API-Key": "api-key-abc"
}
)
response.code #=>200
response.headers #=> Hash
response.headers[:date] #=> Fri, 25 Aug 2023 17:22:33 GMT
response.headers[:last_modified] #=> Wed, 23 Aug 2023 11:41:12 GMT
response.headers[:content_type] #=> video/mp4
response.headers[:accept_range] #=> bytes
response.headers[:content_length] #=> 10338267
resource = RestMan::Resource.new("http://example.com/video/1.mp4")
resposne = resource.head({
"X-API-Key": "api-key-abc"
})
response.code #=>200
response.headers #=> Hash
response.headers[:date] #=> Fri, 25 Aug 2023 17:22:33 GMT
response.headers[:last_modified] #=> Wed, 23 Aug 2023 11:41:12 GMT
response.headers[:content_type] #=> video/mp4
response.headers[:accept_range] #=> bytes
response.headers[:content_length] #=> 10338267
RestMan CLI hasn't support head request.