// This file was generated by Mendix Modeler.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
// Special characters, e.g., é, ö, à, etc. are supported in comments.
package communitycommons.actions;
import communitycommons.Misc;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
/**
* Retrieves data (such as an HTML page) from an URL using the HTTP protocol, and returns it as string.
*
* - url : The URL to retrieve.
* - post : Data to be sent in the request body. If set, a POST request will be send, otherwise a GET request is used.
*
* Example urls:
* 'https://mxforum.mendix.com/search/'
* 'http://www.google.nl/#hl=nl&q=download+mendix'
*
* Example post data:
* 'ipSearchTag=url&x=0&y=0'
*/
public class retrieveURL extends CustomJavaAction<java.lang.String>
{
private java.lang.String url;
private java.lang.String postdata;
public retrieveURL(IContext context, java.lang.String url, java.lang.String postdata)
{
super(context);
this.url = url;
this.postdata = postdata;
}
@Override
public java.lang.String executeAction() throws Exception
{
// BEGIN USER CODE
return Misc.retrieveURL(url, postdata);
// END USER CODE
}
/**
* Returns a string representation of this action
*/
@Override
public java.lang.String toString()
{
return "retrieveURL";
}
// BEGIN EXTRA CODE
// END EXTRA CODE
}