提交 07d82db5 编写于 作者: 如梦技术's avatar 如梦技术 🐛

优化 mica http,减少对 spring 的依赖.

上级 cc0b3825
......@@ -21,7 +21,6 @@ import net.dreamlu.mica.core.utils.StringPool;
import okhttp3.*;
import okhttp3.internal.http.HttpMethod;
import okhttp3.logging.HttpLoggingInterceptor;
import org.springframework.util.Assert;
import javax.annotation.Nullable;
import java.io.IOException;
......@@ -154,7 +153,9 @@ public class HttpRequest {
private HttpRequest(final Request.Builder requestBuilder, String url, String httpMethod) {
HttpUrl httpUrl = HttpUrl.parse(url);
Assert.notNull(httpUrl, String.format("Url 不能解析: %s: [%s]。", httpMethod.toLowerCase(), url));
if (httpUrl == null) {
throw new IllegalArgumentException(String.format("Url 不能解析: %s: [%s]。", httpMethod.toLowerCase(), url));
}
this.requestBuilder = requestBuilder;
this.uriBuilder = httpUrl.newBuilder();
this.httpMethod = httpMethod;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册