I want to create an extension that would send and fetch json data.
You pass url and Post parameters to it, it would fetch data and process it and return data in json format indicating “SUCCESS”/“FAIL”.
However Im stuck at a point as to
how to use the WEB component in my function,
How to pass URL and PostText To it.
And lastly how to capture the data from GotText event.
My function looks as :
@SimpleFunction
public void sendData(String url,String dataToSend){
//How i declare WEB component here <==
this.url = url;
this.dataToSend = dataToSend;
//is this correct way to pass the data ?
this.web.Url(this.url);
this.web.PostText(this.dataToSend);
//how to capture data received by the WEB component and raise your own event with output
}
Its almost same concept as i wanted except i want to receive data not a file.
How do i do it ?
Please send code on how to capture the GotText Event with code, if you are able to.
Thanks.