blob: b5b1abcf6c4be936145267dc5c6ef4313242611f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
/*
* RequestLine.java February 2001
*
* Copyright (C) 2001, Niall Gallagher <niallg@users.sf.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package org.simpleframework.http;
/**
* The <code>RequestLine</code> is used to represent a HTTP request
* line. The methods provided for this can be used to provide easy
* access to the components of a HTTP request line. For the syntax
* of a HTTP request line see RFC 2616.
*
* @author Niall Gallagher
*/
public interface RequestLine {
/**
* This can be used to get the HTTP method for this request. The
* HTTP specification RFC 2616 specifies the HTTP request methods
* in section 9, Method Definitions. Typically this will be a
* GET, POST or a HEAD method, although any string is possible.
*
* @return the request method for this request message
*/
String getMethod();
/**
* This can be used to get the URI specified for this HTTP
* request. This corresponds to the /index part of a
* http://www.domain.com/index URL but may contain the full
* URL. This is a read only value for the request.
*
* @return the URI that this HTTP request is targeting
*/
String getTarget();
/**
* This is used to acquire the address from the request line.
* An address is the full URI including the scheme, domain, port
* and the query parts. This allows various parameters to be
* acquired without having to parse the raw request target URI.
*
* @return this returns the address of the request line
*/
Address getAddress();
/**
* This is used to acquire the path as extracted from the HTTP
* request URI. The <code>Path</code> object that is provided by
* this method is immutable, it represents the normalized path
* only part from the request uniform resource identifier.
*
* @return this returns the normalized path for the request
*/
Path getPath();
/**
* This method is used to acquire the query part from the
* HTTP request URI target. This will return only the values
* that have been extracted from the request URI target.
*
* @return the query associated with the HTTP target URI
*/
Query getQuery();
/**
* This can be used to get the major number from a HTTP version.
* The major version corresponds to the major type that is the 1
* of a HTTP/1.0 version string.
*
* @return the major version number for the request message
*/
int getMajor();
/**
* This can be used to get the major number from a HTTP version.
* The major version corresponds to the major type that is the 0
* of a HTTP/1.0 version string. This is used to determine if
* the request message has keep alive semantics.
*
* @return the major version number for the request message
*/
int getMinor();
}
|