Skip to content

Requests is a lightweight and purely sockets-based Java HTTP client library designed for making HTTP and HTTPS requests with ease and reliability. It provides built-in methods for common HTTP operations and robust error handling

License

Notifications You must be signed in to change notification settings

farhanaliofficial/Requests.java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Requests.java Library

GitHub stars GitHub followers

Author: Farhan Ali

Version: 1.0.3

Overview

Requests is a lightweight and purely sockets-based Java HTTP client library designed for making HTTP and HTTPS requests with ease and reliability. It provides built-in methods for common HTTP operations and robust error handling.

Features

  • Supports HTTP and HTTPS requests.
  • Simplifies GET and POST requests with user-friendly methods.
  • Provides robust error handling for different situations.
  • Easy-to-use for making HTTP requests in Java applications.

Usage

Creating Requests Object

Requests requests = new Requests();

Making a GET Request

String url = "https://example.com";
RequestsResponse response = requests.get(url);

Making a GET Request with Custom Headers

String url = "https://example.com";
Map<String, String> headers = new HashMap<>();
headers.put("User-Agent", "MyApp/1.0");
RequestsResponse response = requests.get(url, headers);

Making a POST Request

String url = "https://example.com";
Map<String, String> data = new HashMap<>();
data.put("param1", "value1");
data.put("param2", "value2");
RequestsResponse response = requests.post(url, data);

Making a POST Request with Custom Headers

String url = "https://example.com";
Map<String, String> headers = new HashMap<>();
headers.put("Authorization", "Bearer Token");
Map<String, String> data = new HashMap<>();
data.put("param1", "value1");
RequestsResponse response = requests.post(url, headers, data);

GitHub Repository

Find the latest updates and contribute to the project on GitHub.

About

Requests is a lightweight and purely sockets-based Java HTTP client library designed for making HTTP and HTTPS requests with ease and reliability. It provides built-in methods for common HTTP operations and robust error handling

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages