@@ -19,6 +19,7 @@ public abstract class CreatubblesRequest<T extends CreatubblesResponse> {
1919 private Map <String , String > urlParameters ;
2020 private Response response ;
2121 private Future <Response > futureResponse ;
22+ private T responseCache ;
2223
2324 public CreatubblesRequest (String endPoint , HttpMethod httpMethod ) {
2425 this (endPoint , httpMethod , null , null );
@@ -145,15 +146,16 @@ public Response getRawResponse() {
145146 }
146147
147148 public T getResponse () {
148- Response response = getRawResponse ();
149- Class <? extends T > responseClass = getResponseClass ();
150- if (response != null && responseClass != null ) {
151- T creatubblesResponse = CreatubblesAPI .GSON .fromJson (response .readEntity (String .class ), responseClass );
152- creatubblesResponse .setOriginatingRequest (this );
153- return creatubblesResponse ;
149+ if (responseCache == null ) {
150+ Response response = getRawResponse ();
151+ Class <? extends T > responseClass = getResponseClass ();
152+ if (response != null && responseClass != null ) {
153+ T creatubblesResponse = CreatubblesAPI .GSON .fromJson (response .readEntity (String .class ), responseClass );
154+ creatubblesResponse .setOriginatingRequest (this );
155+ responseCache = creatubblesResponse ;
156+ }
154157 }
155-
156- return null ;
158+ return responseCache ;
157159 }
158160
159161 public CreatubblesRequest <T > execute () {
0 commit comments