
com.github.qcloudsms.SmsBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qcloudsms Show documentation
Show all versions of qcloudsms Show documentation
this Repository is responsible for qlcoud sms sdk
package com.github.qcloudsms;
import com.github.qcloudsms.httpclient.HTTPClient;
import com.github.qcloudsms.httpclient.HTTPException;
import com.github.qcloudsms.httpclient.HTTPResponse;
public class SmsBase {
protected int appid;
protected String appkey;
protected HTTPClient httpclient;
/**
* SmsBase constructor
*
* @param appid sdk appid
* @param appkey sdk appkey
* @param httpclient http client
*/
public SmsBase(int appid, String appkey, HTTPClient httpclient) {
this.appid = appid;
this.appkey = appkey;
this.httpclient = httpclient;
}
/**
* Handle http status error
*
* @param response raw http response
* @return response raw http response
* @throws HTTPException http status exception
*/
public HTTPResponse handleError(HTTPResponse response) throws HTTPException {
if (response.statusCode < 200 || response.statusCode >= 300) {
throw new HTTPException(response.statusCode, response.reason);
}
return response;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy