This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In a java class, am using an arraylist say reports containing list of all the reports which have reportid, reportname, reporttype etc which i want to add into NameValuePair and send a Http postmethod call to a particular url.
I want to add the arraylists - reportname into name value pair(org.apache.commons.httpclient.NameValuePair) and then use the http client post method to submit the name value pair data to a particular url.
Here is my name value pair
please suggest me how to add the reports arraylist reportname into reports field of NameValuePair.
sangram nani wrote:Here is the code am using to send the data to sales force url along with the salesforce access credentials in the data variable. The sales force url has servlet namespace,
I don't think you quite understand. You asked how to convert an ArrayList of reports to name/value pairs; what you have given me is the code to put those pairs into a request.
The question you need to answer is: what does your URL expect?
Is it it the name "report", followed by a comma-delimited list of report names as the value? Or is it a whole slew of NameValuePair objects of the form:
The answer will determine what you need to do, but only you can answer that question.
Having thought about it, another option might be:
reporttypes=big,small,... but you still have to know what it is.