com.feedhenry.sdk.api
Class FHActRequest
java.lang.Object
com.feedhenry.sdk.FHRemote
com.feedhenry.sdk.api.FHActRequest
- All Implemented Interfaces:
- FHAct
public class FHActRequest
- extends FHRemote
The request for calling the cloud side function of the app. Example:
//calling a cloud side function called "getTweets" and pass in the keywords
FHActRequest request = FH.buildActRequest("getTweets", new JSONObject().put("keyword", "FeedHenry"));
reqeust.executeAsync(new FHActCallback(){
public void success(FHResponse pResp){
JSONObject tweetsObj = pResp.getJson();
...
}
public void fail(FHResponse pResp){
//process error data
...
}
});
Field Summary |
protected static java.lang.String |
LOG_TAG
|
protected JSONObject |
mArgs
|
Method Summary |
protected org.apache.http.Header[] |
buildHeaders(org.apache.http.Header[] pHeaders)
|
protected java.lang.String |
getApiURl()
|
protected java.lang.String |
getPath()
|
protected JSONObject |
getRequestArgs()
|
void |
setArgs(JSONObject pArgs)
Set the parameters for the cloud side function |
void |
setRemoteAction(java.lang.String pAction)
The name of the cloud side function |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mArgs
protected JSONObject mArgs
LOG_TAG
protected static java.lang.String LOG_TAG
FHActRequest
public FHActRequest(android.content.Context context,
CloudProps pCloudProps)
- Constructor
- Parameters:
pProps
- the app configurationpCloudProps
- the properties returned from the cloud
getApiURl
protected java.lang.String getApiURl()
- Overrides:
getApiURl
in class FHRemote
setRemoteAction
public void setRemoteAction(java.lang.String pAction)
- The name of the cloud side function
- Parameters:
pAction
- cloud side function name
setArgs
public void setArgs(JSONObject pArgs)
- Set the parameters for the cloud side function
- Parameters:
pArgs
- the parameters that will be passed to the cloud side function
- Throws:
java.lang.Exception
JSONException
getRequestArgs
protected JSONObject getRequestArgs()
- Specified by:
getRequestArgs
in class FHRemote
getPath
protected java.lang.String getPath()
- Specified by:
getPath
in class FHRemote
buildHeaders
protected org.apache.http.Header[] buildHeaders(org.apache.http.Header[] pHeaders)
throws java.lang.Exception
- Specified by:
buildHeaders
in class FHRemote
- Throws:
java.lang.Exception