Class HTTPRequest
- java.lang.Object
- 
- com.inductiveautomation.snap.websites.HTTPRequest
 
- 
 public class HTTPRequest extends java.lang.ObjectA class to represent an HTTP request and generate a response.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classHTTPRequest.HeaderA class to hold headers.
 - 
Constructor SummaryConstructors Constructor Description HTTPRequest(java.lang.String aString)Creates a new URL from string.HTTPRequest(java.net.URL aURL)Creates a new URL from Java URL.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(java.lang.String aKey, java.lang.String aValue)Adds a header for key.byte[]getBytes()Returns the bytes associated with request (POST).java.lang.StringgetCookie()Returns the cookie.java.util.List<HTTPRequest.Header>getHeaders()Returns the headers.HTTPResponsegetResponse()Executes this request and returns a response.java.net.URLgetURL()Returns the URL.java.lang.StringgetURLString()Returns the URL string.voidsetBytes(byte[] theBytes)Sets the bytes associated with the request (POST).voidsetCookie(java.lang.String aString)Sets the cookie.java.lang.StringtoString()Standard toString implementation.
 
- 
- 
- 
Method Detail- 
getURLpublic java.net.URL getURL() Returns the URL.
 - 
getURLStringpublic java.lang.String getURLString() Returns the URL string.
 - 
getCookiepublic java.lang.String getCookie() Returns the cookie.
 - 
setCookiepublic void setCookie(java.lang.String aString) Sets the cookie.
 - 
getHeaderspublic java.util.List<HTTPRequest.Header> getHeaders() Returns the headers.
 - 
addHeaderpublic void addHeader(java.lang.String aKey, java.lang.String aValue)Adds a header for key.
 - 
getBytespublic byte[] getBytes() Returns the bytes associated with request (POST).
 - 
setBytespublic void setBytes(byte[] theBytes) Sets the bytes associated with the request (POST).
 - 
getResponsepublic HTTPResponse getResponse() throws java.io.IOException Executes this request and returns a response.- Throws:
- java.io.IOException
 
 - 
toStringpublic java.lang.String toString() Standard toString implementation.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-