@@ -40,12 +40,12 @@ public GXRestAPIClient()
4040 public string ErrorMessage { get ; set ; }
4141
4242 public int StatusCode { get ; set ; }
43-
43+ public string StatusMessage { get ; set ; }
4444 public int ResponseCode { get => responseCode ; set => responseCode = value ; }
4545 public string ResponseMessage { get => responseMessage ; set => responseMessage = value ; }
4646 public string HttpMethod { get => httpMethod ; set => httpMethod = value ; }
4747
48- public string protocol = "REST" ;
48+ public int protocol = 1 ;
4949
5050 private string httpMethod = "GET" ;
5151
@@ -336,6 +336,9 @@ public void AddUploadFile(string FilePath, string name)
336336 public void RestExecute ( )
337337 {
338338 this . ErrorCode = 0 ;
339+ this . ErrorMessage = "" ;
340+ this . StatusCode = 0 ;
341+ this . StatusMessage = "" ;
339342 _queryString = String . Empty ;
340343 if ( _queryVars . Count > 0 )
341344 {
@@ -380,16 +383,16 @@ public void RestExecute()
380383 serviceuri += "/" + this . Location . BaseUrl . TrimEnd ( '/' ) . TrimStart ( '/' ) + "/" + this . Location . ResourceName ;
381384 serviceuri += _queryString ;
382385 httpClient . HttpClientExecute ( this . HttpMethod , serviceuri ) ;
386+ this . ErrorCode = ( httpClient . ErrCode == 0 ) ? 1 : httpClient . ErrCode ;
387+ this . ErrorMessage = httpClient . ErrDescription ;
388+ this . StatusCode = httpClient . StatusCode ;
389+ this . StatusMessage = httpClient . ReasonLine ;
383390 if ( httpClient . StatusCode >= 300 || httpClient . ErrCode > 0 )
384391 {
385- this . ErrorCode = ( httpClient . ErrCode == 0 ) ? 1 : httpClient . ErrCode ;
386- this . ErrorMessage = httpClient . ErrDescription ;
387- this . StatusCode = httpClient . StatusCode ;
388392 _responseData = new Dictionary < string , object > ( ) ;
389393 }
390394 else
391395 {
392- this . StatusCode = httpClient . StatusCode ;
393396 _responseData = GeneXus . Utils . RestAPIHelpers . ReadRestParameters ( httpClient . ToString ( ) ) ;
394397 }
395398 }
0 commit comments