Skip to content

How to create REST API with optional parameters?

I need to implement an API with these path params. Can the second and third params by optional? So the client need not pass these, but have to pass the first and last. If this is not possible, then is it recommended to rearrange the params in this way? How to provide the optional params? Answer You can match …

Java: Importing StringUtils

I am trying to import StringUtils. My first step was downloading ‘commons-lang3-3.4.jar’ which I included in the same directory as my PersonTester.java file that I am working on. In my PersonTester.java in which I intend to use StringUtils, I include: When I try and compile I get the following err…

Android Studio FloatingActionButton error

I installed Android Studio yesterday, and after battling multiple java and other errors, I have come to an error that I cannot seem to fix. I have not added anything or done any code, I have simply just started a new project and I get this error in the Preview over the phone: Rendering Problems: Followed by a…

Retrofit: How to wait for response

I have AsyncTask and the doInBackground method inside which, I sending POST request using Retrofit. My code looks like: The problem is: Retrofit sending request asynchronously and while it, the doInBackground method returning the value. So I need to send a request in the same thread with all executions in the…