• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / httpunit / 755

14 Feb 2026 07:14PM UTC coverage: 80.526%. Remained the same
755

push

github

hazendaz
[ci] Fix badge

3213 of 4105 branches covered (78.27%)

Branch coverage included in aggregate %.

8245 of 10124 relevant lines covered (81.44%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/src/main/java/com/meterware/httpunit/HeadMethodWebRequest.java
1
/*
2
 * SPDX-License-Identifier: MIT
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2000-2026 Russell Gold
6
 * Copyright 2021-2000 hazendaz
7
 */
8
package com.meterware.httpunit;
9

10
import java.net.URL;
11

12
/**
13
 * A web request using the HEAD method. This request is used to obtain header information for a resource without
14
 * necessarily waiting for the data to be computed or transmitted. RFC 2616
15
 * http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html defines: 9.4 HEAD The HEAD method is identical to GET except
16
 * that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in
17
 * response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can
18
 * be used for obtaining metainformation about the entity implied by the request without transferring the entity-body
19
 * itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.
20
 * The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be
21
 * used to update a previously cached entity from that resource. If the new field values indicate that the cached entity
22
 * differs from the current entity (as would be indicated by a change in Content-Length, Content-SHA-256, ETag or
23
 * Last-Modified), then the cache MUST treat the cache entry as stale.
24
 **/
25
public class HeadMethodWebRequest extends HeaderOnlyWebRequest {
26

27
    /**
28
     * initialize me - set method to HEAD.
29
     */
30
    private void init() {
31
        super.setMethod("HEAD");
1✔
32
    }
1✔
33

34
    /**
35
     * Creates a new head request from a complete URL string.
36
     *
37
     * @param urlString
38
     *            the URL desired, including the protocol.
39
     */
40
    public HeadMethodWebRequest(String urlString) {
41
        super(urlString);
1✔
42
        init();
1✔
43
    }
1✔
44

45
    /**
46
     * Creates a new head request using a relative URL and base.
47
     *
48
     * @param urlBase
49
     *            the base URL.
50
     * @param urlString
51
     *            the relative URL
52
     */
53
    public HeadMethodWebRequest(URL urlBase, String urlString) {
54
        super(urlBase, urlString);
×
55
        init();
×
56
    }
×
57

58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc