Android-RESTapi icon indicating copy to clipboard operation
Android-RESTapi copied to clipboard

Allow REST request to plain http servers

Open luisfcorreia opened this issue 12 years ago • 5 comments

A good fix would be allowing "useSsl" in RestRequest to be public instead of only private.

I had to change the default to false in order to make it work for me.

luisfcorreia avatar Sep 01 '13 14:09 luisfcorreia

It is private, but you can set it via the setSsl method in RestRequest. Or did you want to read it's current value?

manavo avatar Sep 01 '13 14:09 manavo

I'm just creating a class that extends RestAPI. that method is not exposed there.

It is very likely that I'm doing this the wrong way. (it wouldn't be the first time)

luisfcorreia avatar Sep 01 '13 14:09 luisfcorreia

Well, I'd say one of 2 things:

  1. Make a "getter", so just like setSsl, you can have getSsl, which gives you the value.
  2. Make it protected. If you want it accessible from the extending class, you'll be able to read/write the value.

manavo avatar Sep 01 '13 14:09 manavo

Could be fixed by adding this to RestApi.java

public void setSSL(Boolean ssl) {
    this.rest.setSsl(ssl);
}

luisfcorreia avatar Sep 01 '13 14:09 luisfcorreia

Ah, sorry! Misread which class you're extending!

Yes, that would allow you to set it after instantiating the class. I usually set it in the constructor of my class which extends RestApi.

manavo avatar Sep 01 '13 17:09 manavo