Monday, August 8, 2011

[android-developers] Re: HTTPS in Android

Hi All,

Below is my code snippet:

File file = new File(filepath);
HttpClient client = new DefaultHttpClient();

//String url = "http://test.....;
String url = "https://test......";

HttpPost post = new HttpPost(url);
FileEntity bin = new FileEntity(file, url);

post.setEntity(bin);

HttpResponse response = client.execute(post);

HttpEntity resEntity = response.getEntity();

Basically I am using fileentity to do a HTTPPost. Now I want to do
this over https. After implementing https over at the backend I just
modified http to https in the url and tested again. And it is not
working.

Any idea how do i resolve this?

Thanks In Advance,
Perumal

On Aug 4, 1:43 pm, Kumar Bibek <coomar....@gmail.com> wrote:
> It would be good if you let us know what have your tried and what
> exactly is not working, some code samples, logs etc.
>
> On Aug 2, 8:07 pm, perumal316 <perumal...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi All,
>
> > I have implemented HTTP Post to post data to the backend. How do I
> > implement HTTPS in Android (I have already configured the backend for
> > https)?
>
> > I googled and found some solutions (http://stackoverflow.com/questions/
> > 2253061/secure-http-post-in-android)  and tried them but I do not
> > receive any data in the backend.
>
> > Is it the correct way to implement? Is there any other method?
>
> > Thanks In Advance,
> > Perumal

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment