HttpService
HttpService provides the basic tools to construct URLs properly, and issue HTTP requests, especially those that yield a JSON response.
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Performs an HTTP GET request using the given URI.
Link copied to clipboard
Performs and HTTP GET request expecting a bitmap image file in the response.
Link copied to clipboard
Performs an HTTP GET request assuming that the response body will contain a valid JSON document.
Link copied to clipboard
Performs an HTTP POST request assuming that the response body will contain a valid JSON document.
Link copied to clipboard
Performs an HTTP POST request using the given URI.
Link copied to clipboard
Reads all data from the given InputStream and converts to a String (Uses StringBuilder).
Link copied to clipboard
Parses given string containing JSON data into a JSONObject which provides an interface for extracting JSON data.
Link copied to clipboard
Reads all data from the given Reader and converts to a String (Uses StringBuilder).
Link copied to clipboard
This is the same as {doDeleteRequest} but returns a {{HttpResponse} instead.
Link copied to clipboard
This is the same as {doGetRequest} but returns a {{HttpResponse} instead.
Link copied to clipboard
Same as {doJSONGetRequest} but this returns a {{HttpResponse}} instead.
Same as {doJSONGetRequest )}} but this returns a {{HttpResponse}} instead.
Link copied to clipboard
Same as {doJSONPostRequest} but this returns a {{HttpResponse}} instead.
open fun runJSONPostRequest(uri: URI, headers: Map<String, String>, requestBody: String): HttpResponse
Link copied to clipboard
This is the same as {doPostRequest} but returns a {{HttpResponse} instead.