此前一直都没遇到也一直相信服务端返回的json数据基本是正确的,直到我们的android端一直崩溃,并在友盟上查到一直报如下的错误: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.internal.bind.ReflectiveTypeAda
1.首先获得url,传入URL类,利用URL的openconnection方法,获得URLConnection,去的输入流,进行操作,具体代码如下: public class NetConnection{ public NetConnection(final String url,final HttpMethod method,final SuccessCallback successCallback, final FailCallback failCallback,final String .