colly_wyx
2018-06-14 12690729bc3f0a3e920051e11d2f5522a15f44bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using Newtonsoft.Json;
using System;
 
namespace PhalApiClientSDK
{
    /**
    * JSON解析
    */
    public class PhalApiClientParserJson : PhalApiClientParser {
 
        public PhalApiClientResponse parse(String apiResult) {
            if (apiResult == null) {
                return new PhalApiClientResponse(408, "", "Request Timeout");
            }
        
            try {
 
                return JsonConvert.DeserializeObject<PhalApiClientResponse>(apiResult);
            } catch (Exception ex) {
                return new PhalApiClientResponse(500, "", "Internal Server Error: " + ex.Message);
            }
        }
    }
}