public class SimpleHttpRequest extends Object
HttpTypes.GET| Modifier and Type | Field and Description |
|---|---|
String |
postBody
The body of the POST request used with
fireJsonPost(String) |
| Constructor and Description |
|---|
SimpleHttpRequest(String hostname)
Load up a HTTP GET request to
hostname |
SimpleHttpRequest(String hostname,
HttpTypes type)
Load up a HTTP request of type
type to hostname |
SimpleHttpRequest(String hostname,
javafx.util.Pair<String,String>[] postParams)
USE THIS ONLY FOR POST REQUESTS WITH PARAMETERS!!!!
|
SimpleHttpRequest(String hostname,
String putFilePath)
USE THIS ONLY FOR PUT REQUESTS!!!!
|
| Modifier and Type | Method and Description |
|---|---|
String |
fire()
Decides which type of request to fire off based on the type stated.
|
String |
getResponse() |
public String postBody
fireJsonPost(String)public SimpleHttpRequest(String hostname, HttpTypes type)
type to hostnamehostname - The host to requesttype - The type of HTTP requestHttpTypespublic SimpleHttpRequest(String hostname)
hostnamehostname - The host to requestpublic SimpleHttpRequest(String hostname, String putFilePath)
Loads up a PUT request to hostname. The data that will be "put"
on the server will be data read in from putFilePath
hostname - The host to requestputFilePath - The data to putpublic SimpleHttpRequest(String hostname, javafx.util.Pair<String,String>[] postParams)
Loads up a post request with the given parameters.
hostname - The host to requestpostParams - The url parameters (var=val associates to key=value (in Java)public String fire() throws IOException
IOException - if the server wasn't reachable for some reasonpublic String getResponse()
Copyright © 2017. All rights reserved.