Thanks for your reply.
I tried using HttpDelete but was not able to send the xml data.
so i tried in this way...
URL url = new URL("http://myurl goes here");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("DELETE");
OutputStreamWriter wr = new OutputStreamWriter(conn
.getOutputStream());
// this is were we're adding post data to the request
wr.write(sb.toString());
wr.flush();
myInputStream = conn.getInputStream();
wr.close();
However when writing to the OutputStream of the HttpURLConnection I
get a ProtocolException with the detail message "This method does not
support writing: DELETE".
Any ideas?
Thanks in advance
On Mar 3, 10:15 pm, social hub <[email protected]> wrote:
> http://developer.android.com/intl/de/reference/org/apache/http/client...
>
> On Wed, Mar 3, 2010 at 10:51 AM, vidya <[email protected]> wrote:
> > Hi all,
>
> > I want to ping a url and post a xml to it using http delete as i want
> > to initiate a delete action on the server side.
>
> > But i am not able to post the xml using http delete.
>
> > HttpClient httpclient = new DefaultHttpClient();
> > HttpDelete httpDel = new HttpDelete("http://myurl
> > goes here /");
> > StringEntity stringEntity = new
> > StringEntity(writer.toString());
>
> > ((HttpResponse) httpDel).setEntity(stringEntity);
> > HttpResponse rsp = httpclient.execute(httpDel);
>
> > Need urgent help.
>
> > Thanks in advance..
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en