Package org.javalite.http
Class Post
- java.lang.Object
-
- org.javalite.http.Request<Post>
-
- org.javalite.http.Post
-
-
Field Summary
-
Fields inherited from class org.javalite.http.Request
connection, redirect, url
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PostdoConnect()Makes a connection to the remote resource.static voidmain(String[] args)Postparam(String name, String value)Adds a parameter to the request as in a HTML form.Postparams(String... namesAndValues)Convenience method to add multiple parameters to the request.-
Methods inherited from class org.javalite.http.Request
basic, basic, bytes, connect, dispose, getInputStream, header, headers, redirect, responseCode, responseMessage, text, text
-
-
-
-
Constructor Detail
-
Post
public Post(String url, byte[] content, int connectTimeout, int readTimeout)
Constructor for making POST requests.- Parameters:
url- URL of resource.content- content to be posted to the resource.connectTimeout- connection timeout.readTimeout- read timeout.
-
-
Method Detail
-
doConnect
public Post doConnect()
Description copied from class:RequestMakes a connection to the remote resource.
-
params
public Post params(String... namesAndValues)
Convenience method to add multiple parameters to the request. Names and values alternate: name1, value1, name2, value2, etc.- Parameters:
namesAndValues- names/values of multiple fields to be added to the request.- Returns:
- self
-
param
public Post param(String name, String value)
Adds a parameter to the request as in a HTML form.- Parameters:
name- name of parametervalue- value of parameter- Returns:
- self
-
main
public static void main(String[] args)
-
-