https://github.com/hellokaton/oh-my-request
🔮 simple request library by java8
https://github.com/hellokaton/oh-my-request
http-client network request
Last synced: 4 months ago
JSON representation
🔮 simple request library by java8
- Host: GitHub
- URL: https://github.com/hellokaton/oh-my-request
- Owner: hellokaton
- License: apache-2.0
- Created: 2015-12-24T09:01:34.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-17T02:40:52.000Z (almost 8 years ago)
- Last Synced: 2025-04-05T16:23:03.930Z (9 months ago)
- Topics: http-client, network, request
- Language: Java
- Homepage:
- Size: 38.1 KB
- Stars: 43
- Watchers: 3
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# oh-my-request
`HTTP` request easier operation.
[](https://travis-ci.org/biezhi/oh-my-request)
[](http://search.maven.org/#search%7Cga%7C1%7Coh-my-request)
[](https://github.com/biezhi/oh-my-request/blob/master/LICENSE)
[](https://www.zhihu.com/people/biezhi)
[](https://github.com/biezhi)
# Usage
**Maven ArtifactId**
```xml
io.github.biezhi
oh-my-request
0.0.1
```
## 1. Get Request
```java
String body = Request.get("https://github.com/opensearch.xml").body();
System.out.println(body);
```
## 2. Save To File
```java
Request.get("https://avatars3.githubusercontent.com/u/3849072?v=3&s=460")
.receive(new File("D:/avatar.png"));
```
## 3. Post Request
```java
Request.post("http://xxxx.com")
.form("name", "jack")
.body();
```
## 4. Headers
```java
Request.get("http://xxxx.com")
.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) xxxx")
.body();
```
# License
[Apache2](https://github.com/biezhi/oh-my-request/blob/master/LICENSE)