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:
- Make a "getter", so just like
setSsl
, you can havegetSsl
, which gives you the value. - 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.