Package de.linusdev.lutils.http_WIP
Class HTTPRequest<B>
java.lang.Object
de.linusdev.lutils.http_WIP.HTTPRequest<B>
-
Constructor Summary
ConstructorsConstructorDescriptionHTTPRequest(@NotNull RequestMethod method, @Nullable String path, @NotNull HTTPVersion version, @NotNull Map<String, Header> headers, B body) -
Method Summary
Modifier and TypeMethodDescriptiongetBody()Bodyof this request.Map ofheadersof this request.@NotNull RequestMethodRequestMethodof this request.@Nullable StringgetPath()Requested path@NotNull HTTPVersionHTTPVersionof this request.static @NotNull HTTPRequest<Void>parse(@NotNull InputStream in) static <B> @NotNull HTTPRequest<B>parse(@NotNull InputStream in, @NotNull BodyParser<B> parser)
-
Constructor Details
-
HTTPRequest
public HTTPRequest(@NotNull @NotNull RequestMethod method, @Nullable @Nullable String path, @NotNull @NotNull HTTPVersion version, @NotNull @NotNull Map<String, Header> headers, @Nullable B body)
-
-
Method Details
-
parse
@NotNull public static <B> @NotNull HTTPRequest<B> parse(@NotNull @NotNull InputStream in, @NotNull @NotNull BodyParser<B> parser) throws IOException - Throws:
IOException
-
parse
@NotNull public static @NotNull HTTPRequest<Void> parse(@NotNull @NotNull InputStream in) throws IOException - Throws:
IOException
-
getMethod
RequestMethodof this request.- Returns:
RequestMethod
-
getPath
Requested path- Returns:
- requested path as
String.
-
getVersion
HTTPVersionof this request.- Returns:
HTTPVersion
-
getHeaders
Map ofheadersof this request.- Returns:
- Map of
headers
-
getBody
Bodyof this request.- Returns:
Bodyornull, if theBodyParserreturnednull.
-