You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code provides a simple HTTP wrapper for making GET and POST requests. It includes classes and methods to perform HTTP requests and handle the response.
5
+
This library provides a simple HTTP wrapper for making GET, POST, and other requests. It includes classes and methods to
6
+
perform HTTP requests and handle the response.
4
7
5
-
## SimpleHttpResponse
8
+
## HttpResponse
6
9
7
-
The `SimpleHttpResponse` class represents the response from an HTTP request. It contains the following methods:
10
+
The `HttpResponse` class represents the response from an HTTP request. It contains the following methods:
8
11
9
12
-`getStatusCode()`: Returns the status code of the response.
10
-
-`getData()`: Returns the data (response body) of the response.
13
+
-`getHeaders()`: Returns the headers of the response.
14
+
-`getBody()`: Returns the body (response data) of the response.
11
15
12
-
## SimpleHttpWrapper
16
+
## HttpWrapper
13
17
14
-
The `SimpleHttpWrapper` class provides static methods to make HTTP requests. It includes the following methods:
18
+
The `HttpWrapper` class provides static methods to make HTTP requests. It includes the following methods (and more):
15
19
16
-
-`get(String urlStr, String[] headers)`: Performs a GET request to the specified URL with optional headers and returns a `SimpleHttpResponse`.
17
-
-`post(String urlStr, String[] headers, String postData)`: Performs a POST request to the specified URL with optional headers and post data, and returns a `SimpleHttpResponse`.
18
-
-`performRequest(SupportedHttpMethod method, String urlStr, String[] headers, String postData)`: Performs an HTTP request with the specified method (GET or POST), URL, headers, and post data. Returns a `SimpleHttpResponse`.
19
-
-`performRequestUnsupported(String method, String urlStr, String[] headers, String postData)`: Discouraged method for performing an HTTP request with an unsupported method. Returns a `SimpleHttpResponse`.
20
+
-`get(String urlStr, String[] headers)`: Performs a GET request to the specified URL with optional headers and returns
21
+
a `SimpleHttpResponse`.
22
+
-`post(String urlStr, String[] headers, String postData)`: Performs a POST request to the specified URL with
23
+
optionalheaders and post data, and returns a `SimpleHttpResponse`.
0 commit comments