Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Konloch/HTTPRequest
HTTPRequest is an easy-to-use zero dependency Java wrapper to read from a URL. Support for Cookies, proxies, UserAgent, post data and more.
https://github.com/Konloch/HTTPRequest
cookies http-client http-request http-requests httprequest java java-8 java-library library postdata proxies proxy useragent
Last synced: 3 months ago
JSON representation
HTTPRequest is an easy-to-use zero dependency Java wrapper to read from a URL. Support for Cookies, proxies, UserAgent, post data and more.
- Host: GitHub
- URL: https://github.com/Konloch/HTTPRequest
- Owner: Konloch
- License: mit
- Created: 2015-01-08T13:29:30.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-16T17:14:54.000Z (over 1 year ago)
- Last Synced: 2024-07-01T10:53:34.963Z (4 months ago)
- Topics: cookies, http-client, http-request, http-requests, httprequest, java, java-8, java-library, library, postdata, proxies, proxy, useragent
- Language: Java
- Homepage: https://konloch.com/HTTPRequest/
- Size: 41 KB
- Stars: 20
- Watchers: 6
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# HTTPRequest
HTTPRequest is an easy-to-use zero dependency Java wrapper to read from a URL.Support for Cookies, proxies, UserAgent, post data and more.
## 💡 Requirements
+ Java Runtime 1.8 **or higher**## ⚙️ How To Add As Library
Add it as a maven dependency or just [download the latest release](https://github.com/Konloch/HTTPRequest/releases).
```xmlcom.konloch
HTTPRequest
2.2.0```
## 📚 Links
* [Website](https://konloch.com/HTTPRequest/)
* [Discord Server](https://discord.gg/aexsYpfMEf)
* [Download Releases](https://konloch.com/HTTPRequest/releases)## 💻 How To Use
**Simple Request:**
```java
HTTPRequest request = new HTTPRequest(new URL("https://google.com/"));
ArrayList webpage = request.read();for(String line : webpage)
System.out.println(line);
```**Advanced Request:**
```java
HTTPRequest request = new HTTPRequest(new URL("https://google.com/"));
request.setTimeout(10000);
request.setPostData("postdata=yes&awesome=yup");
request.setReferer("http://google.com/");
request.setCookie("cookies=yes;cool=sure");
request.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 81)));ArrayList webpage = request.read();
for(String line : webpage)
System.out.println(line);for (Map.Entry> k : request.getLastConnectionHeaders())
System.out.println("Header Value:" + k.toString());
```