File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/Proyecto26.RestClient/Helpers Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ namespace Proyecto26
88{
99 public static class HttpBase
1010 {
11+ public static int HTTP_NO_CONTENT = 204 ;
12+
1113 public static IEnumerator CreateRequestAndRetry ( RequestHelper options , Action < RequestException , ResponseHelper > callback )
1214 {
1315
@@ -118,7 +120,7 @@ public static IEnumerator DefaultUnityWebRequest<TResponse>(RequestHelper option
118120 var body = default ( TResponse ) ;
119121 try
120122 {
121- if ( err == null && res . Data != null && options . ParseResponseBody )
123+ if ( err == null && res . StatusCode != HTTP_NO_CONTENT && res . Data != null && options . ParseResponseBody )
122124 body = JsonUtility . FromJson < TResponse > ( res . Text ) ;
123125 }
124126 catch ( Exception error )
@@ -139,7 +141,7 @@ public static IEnumerator DefaultUnityWebRequest<TResponse>(RequestHelper option
139141 var body = default ( TResponse [ ] ) ;
140142 try
141143 {
142- if ( err == null && res . Data != null && options . ParseResponseBody )
144+ if ( err == null && res . StatusCode != HTTP_NO_CONTENT && res . Data != null && options . ParseResponseBody )
143145 body = JsonHelper . ArrayFromJson < TResponse > ( res . Text ) ;
144146 }
145147 catch ( Exception error )
You can’t perform that action at this time.
0 commit comments