-
Notifications
You must be signed in to change notification settings - Fork 0
Java SE 7+ package. Read/write/store HTTP message head (request/status line, headers)
License
miktim/HttpHead
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
# Java SE 7+ HttpHead class. Read/write/store HTTP message head. MIT (c) 2020-2023 miktim@mail.ru Release notes: - the header names (keys) ara case-insensitive; - multiple header values are stored on one line, separated by commas; - the HTTP message request/status line is accessed using START_LINE constant; - without any data control. package org.miktim.http; Overview: Class HttpHead; Constructors: HttpHead(); HttpHead(Map<String, String> m); Constants: static String START_LINE; // key to access the request/status line Methods: static String join(String[] s, char separator); // join strings with separator HttpHead set(String key, String value); // create or overwrite header value HttpHead setValues(String key, String[] values); // create or overwrite header with comma separated values HttpHead add(String key, String value); // add comma separated value or create header String get(String key); String[] getValues(String key); // returns array of comma separated values String remove(String key); // returns header value or null boolean containsKey(String key); List<String> nameList(); // returns list of header names Map<String, String> headMap(); HttpHead read(InputStream is) throws IOException; void write(OutputStream os) throws IOException; // !set start-line before writing String toString(); // creates http header with a request/status line, headers and a trailing blank line Usage: See WebSocket package WsConnection class handshakeClient, handshakeServer methods.
About
Java SE 7+ package. Read/write/store HTTP message head (request/status line, headers)
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published