Source code: com/meterware/httpunit/HeadMethodWebRequest.java
1 package com.meterware.httpunit;
2
3 import java.net.URL;
4
5 /********************************************************************************************************************
6 * $Id: HeadMethodWebRequest.java,v 1.1 2002/10/31 00:25:45 russgold Exp $
7 *
8 * Copyright (c) 2002, Russell Gold
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
11 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
13 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
19 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 *******************************************************************************************************************/
25
26 /**
27 * A web request using the HEAD method. This request is used to obtain header information for a resource
28 * without necessarily waiting for the data to be computed or transmitted.
29 *
30 * @author <a href="mailto:russgold@httpunit.org">Russell Gold</a>
31 **/
32 public class HeadMethodWebRequest extends HeaderOnlyWebRequest {
33
34 /**
35 * Creates a new head request from a complete URL string.
36 * @param urlString the URL desired, including the protocol.
37 */
38 public HeadMethodWebRequest( String urlString ) {
39 super( urlString );
40 }
41
42
43 /**
44 * Creates a new head request using a relative URL and base.
45 * @param urlBase the base URL.
46 * @param urlString the relative URL
47 */
48 public HeadMethodWebRequest( URL urlBase, String urlString ) {
49 super( urlBase, urlString );
50 }
51
52
53 public String getMethod() {
54 return "HEAD";
55 }
56 }