@@ -1634,7 +1634,7 @@ def get(path, initheader = nil, dest = nil, &block) # :yield: +body_segment+
1634
1634
# returns an instance of a subclass of Net::HTTPResponse.
1635
1635
#
1636
1636
# The request is based on the Net::HTTP::Head object
1637
- # created from string +path+ and initial headers hash +initheader+.
1637
+ # created from string +path+ and initial headers hash +initheader+:
1638
1638
#
1639
1639
# res = http.head('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true>
1640
1640
# res.body # => nil
@@ -1709,66 +1709,140 @@ def patch(path, data, initheader = nil, dest = nil, &block) # :yield: +body_segm
1709
1709
send_entity ( path , data , initheader , dest , Patch , &block )
1710
1710
end
1711
1711
1712
- def put ( path , data , initheader = nil ) #:nodoc:
1712
+ # Sends a PUT request to the server;
1713
+ # returns an instance of a subclass of Net::HTTPResponse.
1714
+ #
1715
+ # The request is based on the Net::HTTP::Put object
1716
+ # created from string +path+, string +data+, and initial headers hash +initheader+.
1717
+ #
1718
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1719
+ # http.put('/todos/1', data) # => #<Net::HTTPOK 200 OK readbody=true>
1720
+ #
1721
+ def put ( path , data , initheader = nil )
1713
1722
request ( Put . new ( path , initheader ) , data )
1714
1723
end
1715
1724
1716
- # Sends a PROPPATCH request to the +path+ and gets a response,
1717
- # as an HTTPResponse object.
1725
+ # Sends a PROPPATCH request to the server;
1726
+ # returns an instance of a subclass of Net::HTTPResponse.
1727
+ #
1728
+ # The request is based on the Net::HTTP::Proppatch object
1729
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1730
+ #
1731
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1732
+ # http.proppatch('/todos/1', data)
1733
+ #
1718
1734
def proppatch ( path , body , initheader = nil )
1719
1735
request ( Proppatch . new ( path , initheader ) , body )
1720
1736
end
1721
1737
1722
- # Sends a LOCK request to the +path+ and gets a response,
1723
- # as an HTTPResponse object.
1738
+ # Sends a LOCK request to the server;
1739
+ # returns an instance of a subclass of Net::HTTPResponse.
1740
+ #
1741
+ # The request is based on the Net::HTTP::Lock object
1742
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1743
+ #
1744
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1745
+ # http.lock('/todos/1', data)
1746
+ #
1724
1747
def lock ( path , body , initheader = nil )
1725
1748
request ( Lock . new ( path , initheader ) , body )
1726
1749
end
1727
1750
1728
- # Sends a UNLOCK request to the +path+ and gets a response,
1729
- # as an HTTPResponse object.
1751
+ # Sends an UNLOCK request to the server;
1752
+ # returns an instance of a subclass of Net::HTTPResponse.
1753
+ #
1754
+ # The request is based on the Net::HTTP::Unlock object
1755
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1756
+ #
1757
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1758
+ # http.unlock('/todos/1', data)
1759
+ #
1730
1760
def unlock ( path , body , initheader = nil )
1731
1761
request ( Unlock . new ( path , initheader ) , body )
1732
1762
end
1733
1763
1734
- # Sends a OPTIONS request to the +path+ and gets a response,
1735
- # as an HTTPResponse object.
1764
+ # Sends an Options request to the server;
1765
+ # returns an instance of a subclass of Net::HTTPResponse.
1766
+ #
1767
+ # The request is based on the Net::HTTP::Options object
1768
+ # created from string +path+ and initial headers hash +initheader+.
1769
+ #
1770
+ # http.options('/')
1771
+ #
1736
1772
def options ( path , initheader = nil )
1737
1773
request ( Options . new ( path , initheader ) )
1738
1774
end
1739
1775
1740
- # Sends a PROPFIND request to the +path+ and gets a response,
1741
- # as an HTTPResponse object.
1776
+ # Sends a PROPFIND request to the server;
1777
+ # returns an instance of a subclass of Net::HTTPResponse.
1778
+ #
1779
+ # The request is based on the Net::HTTP::Propfind object
1780
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1781
+ #
1782
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1783
+ # http.propfind('/todos/1', data)
1784
+ #
1742
1785
def propfind ( path , body = nil , initheader = { 'Depth' => '0' } )
1743
1786
request ( Propfind . new ( path , initheader ) , body )
1744
1787
end
1745
1788
1746
- # Sends a DELETE request to the +path+ and gets a response,
1747
- # as an HTTPResponse object.
1789
+ # Sends a DELETE request to the server;
1790
+ # returns an instance of a subclass of Net::HTTPResponse.
1791
+ #
1792
+ # The request is based on the Net::HTTP::Delete object
1793
+ # created from string +path+ and initial headers hash +initheader+.
1794
+ #
1795
+ # http.delete('/todos/1')
1796
+ #
1748
1797
def delete ( path , initheader = { 'Depth' => 'Infinity' } )
1749
1798
request ( Delete . new ( path , initheader ) )
1750
1799
end
1751
1800
1752
- # Sends a MOVE request to the +path+ and gets a response,
1753
- # as an HTTPResponse object.
1801
+ # Sends a MOVE request to the server;
1802
+ # returns an instance of a subclass of Net::HTTPResponse.
1803
+ #
1804
+ # The request is based on the Net::HTTP::Move object
1805
+ # created from string +path+ and initial headers hash +initheader+.
1806
+ #
1807
+ # http.move('/todos/1')
1808
+ #
1754
1809
def move ( path , initheader = nil )
1755
1810
request ( Move . new ( path , initheader ) )
1756
1811
end
1757
1812
1758
- # Sends a COPY request to the +path+ and gets a response,
1759
- # as an HTTPResponse object.
1813
+ # Sends a COPY request to the server;
1814
+ # returns an instance of a subclass of Net::HTTPResponse.
1815
+ #
1816
+ # The request is based on the Net::HTTP::Copy object
1817
+ # created from string +path+ and initial headers hash +initheader+.
1818
+ #
1819
+ # http.copy('/todos/1')
1820
+ #
1760
1821
def copy ( path , initheader = nil )
1761
1822
request ( Copy . new ( path , initheader ) )
1762
1823
end
1763
1824
1764
- # Sends a MKCOL request to the +path+ and gets a response,
1765
- # as an HTTPResponse object.
1825
+ # Sends a MKCOL request to the server;
1826
+ # returns an instance of a subclass of Net::HTTPResponse.
1827
+ #
1828
+ # The request is based on the Net::HTTP::Mkcol object
1829
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1830
+ #
1831
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1832
+ # http.mkcol('/todos/1', data)
1833
+ #
1766
1834
def mkcol ( path , body = nil , initheader = nil )
1767
1835
request ( Mkcol . new ( path , initheader ) , body )
1768
1836
end
1769
1837
1770
- # Sends a TRACE request to the +path+ and gets a response,
1771
- # as an HTTPResponse object.
1838
+ # Sends a TRACE request to the server;
1839
+ # returns an instance of a subclass of Net::HTTPResponse.
1840
+ #
1841
+ # The request is based on the Net::HTTP::Trace object
1842
+ # created from string +path+ and initial headers hash +initheader+.
1843
+ #
1844
+ # http.trace('/todos/1')
1845
+ #
1772
1846
def trace ( path , initheader = nil )
1773
1847
request ( Trace . new ( path , initheader ) )
1774
1848
end
0 commit comments