Package snap.web
Class WebRequest
java.lang.Object
snap.web.WebRequest
A request to a server.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionConstructor.WebRequest
(WebFile aFile) Constructor for given file.WebRequest
(WebURL aURL) Constructor for given URL. -
Method Summary
Modifier and TypeMethodDescriptiongetFile()
Returns the File if previously set or cached in site.Returns the file path of request URL.byte[]
Returns the post bytes.getSite()
Returns the site for the request.getType()
Returns the type of request.getURL()
Returns the URL.boolean
Returns whether a request file is directory (only valid if request was created from file).void
setPostBytes
(byte[] theBytes) Sets the bytes to POST.void
setPutBytes
(byte[] theBytes) Sets the bytes to PUT.void
setSendBytes
(byte[] theBytes) Sets the bytes to send.void
setType
(WebRequest.Type aType) Sets the type of request.toString()
Standard toString implementation.
-
Constructor Details
-
WebRequest
public WebRequest()Constructor. -
WebRequest
Constructor for given URL. -
WebRequest
Constructor for given file.
-
-
Method Details
-
getSite
Returns the site for the request. -
getURL
Returns the URL. -
getFile
Returns the File if previously set or cached in site. -
getFilePath
Returns the file path of request URL. -
isFileDir
public boolean isFileDir()Returns whether a request file is directory (only valid if request was created from file). -
getType
Returns the type of request. -
setType
Sets the type of request. -
getSendBytes
public byte[] getSendBytes()Returns the post bytes. -
setSendBytes
public void setSendBytes(byte[] theBytes) Sets the bytes to send. -
setPostBytes
public void setPostBytes(byte[] theBytes) Sets the bytes to POST. -
setPutBytes
public void setPutBytes(byte[] theBytes) Sets the bytes to PUT. -
toString
Standard toString implementation.
-