Class: Gem::Net::HTTP::Delete
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Gem::Net::HTTPRequest
|
Defined in: | lib/rubygems/vendor/net-http/lib/net/http/requests.rb |
Overview
Class for representing {Gem::Net::HTTP method DELETE}:
require 'rubygems/vendor/net-http/lib/net/http'
uri = Gem::URI('http://example.com')
hostname = uri.hostname # => "example.com"
uri.path = '/posts/1'
req = Gem::Net::HTTP::Delete.new(uri) # => #<Gem::Net::HTTP::Delete DELETE>
res = Gem::Net::HTTP.start(hostname) do |http|
http.request(req)
end
See {Gem::Request
Headers}.
Properties:
-
::Gem::Request
body: optional. -
Response body: yes.
-
Safe: no.
-
Idempotent: yes.
-
Cacheable: no.
Related:
-
#delete: sends
DELETE
request, returns response object.
Constant Summary
-
METHOD =
# File 'lib/rubygems/vendor/net-http/lib/net/http/requests.rb', line 160'DELETE'
-
REQUEST_HAS_BODY =
# File 'lib/rubygems/vendor/net-http/lib/net/http/requests.rb', line 161false
-
RESPONSE_HAS_BODY =
# File 'lib/rubygems/vendor/net-http/lib/net/http/requests.rb', line 162true
::Gem::Net::HTTPHeader
- Included
Class Method Summary
::Gem::Net::HTTPRequest
- Inherited
.new | Creates an |
::Gem::Net::HTTPGenericRequest
- Inherited
Instance Attribute Summary
::Gem::Net::HTTPGenericRequest
- Inherited
#body | Returns the string body for the request, or |
#body= | Sets the body for the request: |
#body_stream | Returns the body stream object for the request, or |
#body_stream= | Sets the body stream for the request: |
#decode_content | Returns |
#method | Returns the string method name for the request: |
#path | Returns the string path for the request: |
#request_body_permitted? | Returns whether the request may have a body: |
#response_body_permitted? | Returns whether the response may have a body: |
#uri | Returns the |
#body_exist? |
::Gem::Net::HTTPHeader
- Included
#chunked? | Returns |
#connection_close? | Returns whether the |
#connection_keep_alive? | Returns whether the |
#content_length | Returns the value of field |
#content_length= | Sets the value of field |
Instance Method Summary
::Gem::Net::HTTPGenericRequest
- Inherited
#encode_multipart_form_data, #flush_buffer, | |
#inspect | Returns a string representation of the request: |
#quote_string, #send_request_with_body, #send_request_with_body_data, #send_request_with_body_stream, #supply_default_content_type, | |
#wait_for_continue | Waits up to the continue timeout for a response from the server provided we’re speaking |
#write_header, | |
#[]= | Don’t automatically decode response content-encoding if the user indicates they want to handle it. |
#exec | write. |
#set_body_internal | internal use only. |
#update_uri | internal use only. |
::Gem::Net::HTTPHeader
- Included
#[] | Returns the string field value for the case-insensitive field #key, or |
#[]= | Sets the value for the case-insensitive #key to |
#add_field | |
#basic_auth | Sets header |
#canonical_each | Alias for Gem::Net::HTTPHeader#each_capitalized. |
#content_range | Returns a Range object representing the value of field |
#content_type | Returns the media type from the value of field |
#content_type= | Alias for Gem::Net::HTTPHeader#set_content_type. |
#delete | Removes the header for the given case-insensitive #key (see |
#each | Alias for Gem::Net::HTTPHeader#each_header. |
#each_capitalized | Like |
#each_capitalized_name | Calls the block with each capitalized field name: |
#each_header | Calls the block with each key/value pair: |
#each_key | Alias for Gem::Net::HTTPHeader#each_name. |
#each_name | Calls the block with each field key: |
#each_value | Calls the block with each string field value: |
#fetch | With a block, returns the string value for #key if it exists; otherwise returns the value of the block; ignores the |
#form_data= | Alias for Gem::Net::HTTPHeader#set_form_data. |
#get_fields | Returns the array field value for the given #key, or |
#key? | Returns |
#main_type | Returns the leading (‘type’) part of the media type from the value of field |
#proxy_basic_auth | Sets header |
#range | Returns an array of Range objects that represent the value of field |
#range= | Alias for Gem::Net::HTTPHeader#set_range. |
#range_length | Returns the integer representing length of the value of field |
#set_content_type | Sets the value of field |
#set_form | Stores form data to be used in a |
#set_form_data | Sets the request body to a URL-encoded string derived from argument |
#set_range | Sets the value for field |
#sub_type | Returns the trailing (‘subtype’) part of the media type from the value of field |
#to_hash | Returns a hash of the key/value pairs: |
#type_params | Returns the trailing (‘parameters’) part of the value of field |
#append_field_value, #basic_encode, #capitalize, #set_field, #initialize_http_header, | |
#length | Alias for Gem::Net::HTTPHeader#size. |
#size | obsolete. |
Constructor Details
This class inherits a constructor from Gem::Net::HTTPRequest