public class CurlResource extends ResourceValue
NULL_ARGS, NULL_VALUE_ARRAY
Constructor and Description |
---|
CurlResource() |
Modifier and Type | Method and Description |
---|---|
CurlResource |
clone()
Returns a copy of this resource.
|
void |
close()
By default close() will call cleanup().
|
Value |
execute(Env env,
boolean isPrintData)
Executes this request.
|
Value |
getBody()
Returns body of last transfer.
|
java.lang.String |
getCaInfo() |
int |
getConnectTimeout()
Returns the max time until timeout while establishing a connection.
|
int |
getContentLength()
Returns the length of the body from the last request.
|
java.lang.String |
getContentType()
Returns the "Content-Type" header from the last request.
|
java.lang.String |
getError()
Returns the error string from the last request.
|
int |
getErrorCode()
Sets the error code from the last request.
|
Value |
getHeader()
Returns the header from the last request.
|
Callable |
getHeaderCallback()
Returns the header callback.
|
boolean |
getIsFollowingRedirects()
Returns true if automatically following redirects.
|
boolean |
getIsProxying()
Returns true if a proxy is to be used.
|
boolean |
getIsVerbose()
Returns the verbosity of this library.
|
boolean |
getIsVerifySSLCommonName() |
boolean |
getIsVerifySSLHostname() |
boolean |
getIsVerifySSLPeer() |
java.lang.String |
getPassword()
Returns the password to use for authentication.
|
int |
getPort()
Returns the port to use for this request.
|
Value |
getPostBody()
Gets the body to POST to the server.
|
java.lang.String |
getProxyPassword()
Returns the password to use for proxy authentication.
|
int |
getProxyPort()
Returns the port to use for the proxy.
|
java.lang.String |
getProxyType()
Returns of type of the proxy (Http or SOCKS).
|
java.lang.String |
getProxyURL()
Returns the URL of the proxy.
|
java.lang.String |
getProxyUsername()
Returns the username to use for proxy authentication.
|
Callable |
getReadCallback()
Returns the callback to read the body.
|
int |
getReadTimeout()
Returns the max time until timeout while reading body.
|
java.lang.String |
getRequestMethod()
Returns the current request method.
|
Value |
getRequestProperties(Env env)
Returns all the request properties as a String.
|
java.util.HashMap<java.lang.String,java.lang.String> |
getRequestPropertiesMap()
Returns a map of all the request properties.
|
int |
getResponseCode()
Returns the response code for the last request.
|
StringValue |
getReturnTransfer()
Returns the value for the CURLOPT_RETURNTRANSFER option.
|
java.lang.String |
getSslCert() |
java.lang.String |
getSslCertPassword() |
java.lang.String |
getSslKey() |
java.lang.String |
getSslKeyPassword() |
java.lang.String |
getSslVersion() |
BinaryInput |
getUploadFile()
Returns handle of file to upload.
|
long |
getUploadFileSize()
Returns size of file to upload.
|
java.lang.String |
getURL()
Gets the URL to use for this request.
|
java.lang.String |
getUsername()
Gets the username to use for authentication.
|
Callable |
getWriteCallback() |
protected boolean |
hasError()
Returns true if an error occuring during the last operation.
|
boolean |
isResource()
Returns true for a resource.
|
boolean |
isReturningData()
Returns true if returning data instead of to stdout.
|
void |
removeRequestProperty(java.lang.String key)
Remove a request property.
|
void |
setBody(StringValue body)
Sets the body of the last request.
|
void |
setCaInfo(java.lang.String file) |
void |
setConnectTimeout(int timeoutMs)
Sets the max time until timeout while establishing a connection.
|
void |
setContentLength(int length)
Sets the length of the body from the last request.
|
void |
setContentType(java.lang.String type)
Sets the "Content-Type" from the last request.
|
void |
setCookie(java.lang.String cookie)
Sets the "Set-Cookie" request property.
|
void |
setCookieFilename(java.lang.String filename)
Sets the filename to save the cookies from the last request.
|
void |
setError(java.lang.String error)
Sets the error string from the last request.
|
void |
setErrorCode(int code)
Returns the error code from the last request.
|
void |
setFailOnError(boolean failOnError)
Set to true to fail on response codes >= 400.
|
void |
setHeader(StringValue header)
Saves the header that was returned by the server.
|
void |
setHeaderCallback(Callable callback)
Sets the callback to read the header.
|
void |
setIfModifiedSince(boolean option)
Set to true to set the If-Modified-Since property.
|
void |
setIsFollowingRedirects(boolean followRedirects)
Set to true to automatically follow redirects.
|
void |
setIsProxying(boolean proxy)
Set to true to proxy request.
|
void |
setIsReturningBody(boolean returnBody)
Set to true to return body for this request.
|
void |
setIsReturningData(boolean returnData)
Set to true to return data instead of to stdout.
|
void |
setIsReturningHeader(boolean returnHeader)
Set to true to return the body from this request.
|
void |
setIsVerbose(boolean verbose)
Sets the verbosity of this library.
|
void |
setIsVerifySSLCommonName(boolean isVerify) |
void |
setIsVerifySSLHostname(boolean isVerify) |
void |
setIsVerifySSLPeer(boolean isVerify) |
void |
setModifiedTime(java.lang.String time)
Sets the modified time request property.
|
void |
setOutputFile(BinaryOutput file)
Sets the file to save the data to save from a request.
|
void |
setOutputHeaderFile(BinaryOutput file)
Sets the file to save the header from a request.
|
void |
setPassword(java.lang.String pwd)
Sets the password to use for authentication.
|
void |
setPasswordCallback(Callable callback) |
void |
setPort(int port)
Sets the port to use for this request.
|
void |
setPostBody(Value body)
Sets the body to POST to the server.
|
void |
setProxyPassword(java.lang.String pass)
Sets the password to use for proxy authentication.
|
void |
setProxyPort(int port)
Sets the port to use for the proxy.
|
void |
setProxyType(java.lang.String type)
Sets the type of the proxy (Http or SOCKS).
|
void |
setProxyURL(java.lang.String proxy)
Sets the URL of the proxy.
|
void |
setProxyUsername(java.lang.String user)
Sets the username to use for proxy authentication.
|
void |
setReadCallback(Callable callback)
Sets the callback to read the body.
|
void |
setReadTimeout(int timeoutMs)
Sets the max time until timeout while reading body.
|
void |
setRequestMethod(java.lang.String method)
Sets the request method to use for this request.
|
void |
setRequestProperty(java.lang.String key,
java.lang.String value)
Sets a request property to use for this request.
|
void |
setResponseCode(int code)
Sets the response code for the last request.
|
void |
setSslCert(java.lang.String sslCert) |
void |
setSslCertPassword(java.lang.String sslCertPassword) |
void |
setSslKey(java.lang.String sslKey) |
void |
setSslKeyPassword(java.lang.String sslKeyPassword) |
void |
setSslVersion(java.lang.String sslVersion) |
void |
setUploadFile(BinaryInput file)
Sets handle of file to upload.
|
void |
setUploadFileSize(long size)
Sets size of file to upload.
|
void |
setURL(java.lang.String url)
Sets the URL to use for this request.
|
void |
setUsername(java.lang.String user)
Sets the username to use for authentication.
|
void |
setWriteCallback(Callable callback) |
java.lang.String |
toString()
Converts to a string.
|
cleanup, printRImpl, serialize, toKey, varDumpImpl
abs, add, add, addOne, append, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, call, call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, charValueAt, checkPrivate, checkProtected, clone, cmp, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eq, eql, eqValue, findFunction, findQuercusClass, generate, geq, get, get, getArg, getArgTail, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getClassName, getCount, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getKeyArray, getKeyIterator, getObject, getObject, getObjectHash, getQuercusClass, getRef, getResourceType, getSize, getStaticFieldValue, getStaticFieldVar, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getType, getValueArray, getValueIterator, getValueType, getVar, gt, hasCurrent, hashCode, increment, initField, initField, initField, initIncompleteField, isA, isA, isArray, isBinary, isBoolean, isCallable, isDefault, isDouble, isDoubleConvertible, isEmpty, isEmpty, isFieldExists, isFieldInit, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, isObject, isset, isset, issetField, issetThisField, isString, isUnicode, isVar, jsonEncode, key, keyExists, length, leq, lshift, lt, mod, mul, mul, neg, next, nextIndex, pop, pos, postdecr, postincr, postincr, predecr, preincr, preincr, prev, print, print, printDepth, printJavaChar, printJavaString, printR, put, put, put, putArray, putField, putField, putField, putObject, putThisField, putThisField, putThisFieldArray, putVar, remove, reset, rshift, serialize, set, setCharValueAt, setFieldInit, setJavaObject, setStaticFieldRef, shuffle, sub_rev, sub, sub, subOne, toArgRef, toArray, toArrayValue, toAutoArray, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBoolean, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDouble, toDouble, toDouble, toDouble, toDouble, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaEnum, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLong, toLong, toLong, toLong, toLong, toLongMarshalCost, toLongValue, toObject, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, unsetThisPrivateField, valuesToArray, varDump, varExport, varExportImpl
public java.lang.String getCaInfo()
public void setCaInfo(java.lang.String file)
public java.lang.String getSslVersion()
public void setSslVersion(java.lang.String sslVersion)
public java.lang.String getSslCert()
public void setSslCert(java.lang.String sslCert)
public java.lang.String getSslKey()
public void setSslKey(java.lang.String sslKey)
public java.lang.String getSslKeyPassword()
public void setSslKeyPassword(java.lang.String sslKeyPassword)
public java.lang.String getSslCertPassword()
public void setSslCertPassword(java.lang.String sslCertPassword)
public Value getBody()
public void setBody(StringValue body)
public int getConnectTimeout()
public void setConnectTimeout(int timeoutMs)
public int getContentLength()
public void setContentLength(int length)
public java.lang.String getContentType()
public void setContentType(java.lang.String type)
public void setCookie(java.lang.String cookie)
public void setCookieFilename(java.lang.String filename)
public java.lang.String getError()
public void setError(java.lang.String error)
public int getErrorCode()
public void setErrorCode(int code)
public void setFailOnError(boolean failOnError)
public Value getHeader()
public void setHeader(StringValue header)
public Callable getHeaderCallback()
public void setHeaderCallback(Callable callback)
public void setIfModifiedSince(boolean option)
public boolean getIsFollowingRedirects()
public void setIsFollowingRedirects(boolean followRedirects)
public boolean getIsProxying()
public void setIsProxying(boolean proxy)
public void setIsReturningBody(boolean returnBody)
public boolean isReturningData()
public void setIsReturningData(boolean returnData)
public void setIsReturningHeader(boolean returnHeader)
public boolean getIsVerbose()
public void setIsVerbose(boolean verbose)
public boolean getIsVerifySSLPeer()
public void setIsVerifySSLPeer(boolean isVerify)
public boolean getIsVerifySSLCommonName()
public void setIsVerifySSLCommonName(boolean isVerify)
public boolean getIsVerifySSLHostname()
public void setIsVerifySSLHostname(boolean isVerify)
public void setModifiedTime(java.lang.String time)
public void setOutputFile(BinaryOutput file)
public void setOutputHeaderFile(BinaryOutput file)
public java.lang.String getPassword()
public void setPassword(java.lang.String pwd)
public void setPasswordCallback(Callable callback)
public int getPort()
public void setPort(int port)
public Value getPostBody()
public void setPostBody(Value body)
public java.lang.String getProxyPassword()
public void setProxyPassword(java.lang.String pass)
public int getProxyPort()
public void setProxyPort(int port)
public java.lang.String getProxyType()
public void setProxyType(java.lang.String type)
public java.lang.String getProxyURL()
public void setProxyURL(java.lang.String proxy)
public java.lang.String getProxyUsername()
public void setProxyUsername(java.lang.String user)
public Callable getReadCallback()
public void setReadCallback(Callable callback)
public int getReadTimeout()
public void setReadTimeout(int timeoutMs)
public java.lang.String getRequestMethod()
public void setRequestMethod(java.lang.String method)
public java.util.HashMap<java.lang.String,java.lang.String> getRequestPropertiesMap()
public Value getRequestProperties(Env env)
public void setRequestProperty(java.lang.String key, java.lang.String value)
public int getResponseCode()
public void setResponseCode(int code)
public BinaryInput getUploadFile()
public void setUploadFile(BinaryInput file)
public long getUploadFileSize()
public void setUploadFileSize(long size)
public java.lang.String getURL()
public void setURL(java.lang.String url)
public java.lang.String getUsername()
public void setUsername(java.lang.String user)
public Callable getWriteCallback()
public void setWriteCallback(Callable callback)
public void removeRequestProperty(java.lang.String key)
public StringValue getReturnTransfer()
public void close()
ResourceValue
close
in class ResourceValue
protected boolean hasError()
public CurlResource clone()
clone
in class java.lang.Object
public java.lang.String toString()
ResourceValue
toString
in class ResourceValue
public boolean isResource()
Value
isResource
in class ResourceValue