manavo / Android-RESTapi

A simple Android RESTful library for integrating with RESTful JSON APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow REST request to plain http servers

luisfcorreia opened this issue · 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.

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

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)

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.

Could be fixed by adding this to RestApi.java

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

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.