@@ -40,12 +40,12 @@ public GXRestAPIClient()
40
40
public string ErrorMessage { get ; set ; }
41
41
42
42
public int StatusCode { get ; set ; }
43
-
43
+ public string StatusMessage { get ; set ; }
44
44
public int ResponseCode { get => responseCode ; set => responseCode = value ; }
45
45
public string ResponseMessage { get => responseMessage ; set => responseMessage = value ; }
46
46
public string HttpMethod { get => httpMethod ; set => httpMethod = value ; }
47
47
48
- public string protocol = "REST" ;
48
+ public int protocol = 1 ;
49
49
50
50
private string httpMethod = "GET" ;
51
51
@@ -336,6 +336,9 @@ public void AddUploadFile(string FilePath, string name)
336
336
public void RestExecute ( )
337
337
{
338
338
this . ErrorCode = 0 ;
339
+ this . ErrorMessage = "" ;
340
+ this . StatusCode = 0 ;
341
+ this . StatusMessage = "" ;
339
342
_queryString = String . Empty ;
340
343
if ( _queryVars . Count > 0 )
341
344
{
@@ -380,16 +383,16 @@ public void RestExecute()
380
383
serviceuri += "/" + this . Location . BaseUrl . TrimEnd ( '/' ) . TrimStart ( '/' ) + "/" + this . Location . ResourceName ;
381
384
serviceuri += _queryString ;
382
385
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 ;
383
390
if ( httpClient . StatusCode >= 300 || httpClient . ErrCode > 0 )
384
391
{
385
- this . ErrorCode = ( httpClient . ErrCode == 0 ) ? 1 : httpClient . ErrCode ;
386
- this . ErrorMessage = httpClient . ErrDescription ;
387
- this . StatusCode = httpClient . StatusCode ;
388
392
_responseData = new Dictionary < string , object > ( ) ;
389
393
}
390
394
else
391
395
{
392
- this . StatusCode = httpClient . StatusCode ;
393
396
_responseData = GeneXus . Utils . RestAPIHelpers . ReadRestParameters ( httpClient . ToString ( ) ) ;
394
397
}
395
398
}
0 commit comments