Winston Gutkowski wrote:
sangram nani wrote:i will be using this name value pair to call a http postmethod to a salesforce URL so that the details of name value pair are stored in the salesforce site as a lead.
Yes, but what does that salesforce URL expect? Because that will govern what you put into your NameValuePair instance(s).
Winston
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,.
for (NameValuePair nameValuePair : Data) {
postData[count] = nameValuePair;
count++;
}
post.setRequestBody(postData);
BufferedReader in = null;
try {
int returnCode = client.executeMethod(post);
in = new BufferedReader(new InputStreamReader(
post.getResponseBodyAsStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
response+=inputLine;
System.out.println(inputLine);
}
in.close();