@@ -17,8 +17,8 @@ namespace GeneXus.Application
1717{
1818 public class GXRestAPIClient
1919 {
20- private const string DATE_NULL = "0000-00-00" ;
21- private const string DATETIME_NULL = "0000-00-00'T'00 :00:00" ;
20+ private const string DATE_EMPTY = "0000-00-00" ;
21+ private const string DATETIME_EMPTY = "0000-00-00T00 :00:00" ;
2222 private const string DATE_FORMAT = "yyyy-MM-dd" ;
2323 private const string DATETIME_FORMAT = "yyyy-MM-ddTHH:mm:ss" ;
2424 private const string DATETIME_MS_FORMAT = "yyyy-MM-ddTHH:mm:ss.fff" ;
@@ -275,15 +275,15 @@ public string GetHeaderString(string varName)
275275 public DateTime GetHeaderDate ( string varName )
276276 {
277277 string val = GetHeaderString ( varName ) ;
278- if ( val . StartsWith ( DATE_NULL ) )
278+ if ( val . StartsWith ( DATE_EMPTY ) )
279279 return DateTimeUtil . NullDate ( ) ;
280280 return DateTime . ParseExact ( val , DATE_FORMAT , System . Globalization . CultureInfo . InvariantCulture ) ;
281281 }
282282
283283 public DateTime GetHeaderDateTime ( string varName , bool hasMilliseconds )
284284 {
285285 string val = GetHeaderString ( varName ) ;
286- if ( val . StartsWith ( DATETIME_NULL ) )
286+ if ( val . StartsWith ( DATETIME_EMPTY ) )
287287 return DateTimeUtil . NullDate ( ) ;
288288 string fmt = DATETIME_FORMAT ;
289289 if ( hasMilliseconds )
@@ -345,15 +345,15 @@ public string GetBodyString(string varName)
345345 public DateTime GetBodyDate ( string varName )
346346 {
347347 string val = GetJsonStr ( varName ) ;
348- if ( val . StartsWith ( DATE_NULL ) )
348+ if ( val . StartsWith ( DATE_EMPTY ) )
349349 return DateTimeUtil . NullDate ( ) ;
350350 return DateTime . ParseExact ( val , DATE_FORMAT , System . Globalization . CultureInfo . InvariantCulture ) ;
351351 }
352352
353353 public DateTime GetBodyDateTime ( string varName , bool hasMilliseconds )
354354 {
355355 string val = GetJsonStr ( varName ) ;
356- if ( val . StartsWith ( DATETIME_NULL ) )
356+ if ( val . StartsWith ( DATETIME_EMPTY ) )
357357 return DateTimeUtil . NullDate ( ) ;
358358 string fmt = DATETIME_FORMAT ;
359359 if ( hasMilliseconds )
@@ -482,10 +482,9 @@ public void AddUploadFile(string FilePath, string name)
482482 public void RestExecute ( )
483483 {
484484 this . ErrorCode = 0 ;
485- this . ErrorMessage = "" ;
485+ this . ErrorMessage = "" ;
486486 this . StatusCode = 0 ;
487487 this . StatusMessage = "" ;
488-
489488 if ( _headerVars . Count > 0 )
490489 {
491490 foreach ( string key in _headerVars . Keys )
@@ -543,10 +542,12 @@ public void RestExecute()
543542 this . StatusMessage = httpClient . ReasonLine ;
544543 if ( httpClient . StatusCode >= 300 || httpClient . ErrCode > 0 )
545544 {
545+
546546 _responseData = new Dictionary < string , object > ( ) ;
547547 }
548548 else
549549 {
550+
550551 _responseData = GeneXus . Utils . RestAPIHelpers . ReadRestParameters ( httpClient . ToString ( ) ) ;
551552 }
552553 }
0 commit comments