Open maskainv opened 7 months ago
测试代码: Request request = new Request("http://*.*.*.*:3036/xxxxxx/xx/xx/xx/zz/releaseList"); request.setMethod("GET"); request.getHeaders().put("Authorization", "49ee2c7a-67b7-42cc-ad95-0ae05d25de42"); request.getHeaders().put("Content-Type", "application/json"); Spider spider = Spider.create(new MyPageHandler()) .addRequest(request) .addPipeline(new ConsolePipeline()) .thread(1); spider.getSite().addHeader("Authorization", "49ee2c7a-67b7-42cc-ad95-0ae05d25de42"); spider.run();
自己写了一个download 直接使用hutool的请求工具类直接执行: HttpResponse serviceProfile = HttpRequest.get(url).addHeaders(request.getHeaders()).execute(); 是可以正常有响应报文的,不知道啥情况?
测试代码:
Request request = new Request("http://*.*.*.*:3036/xxxxxx/xx/xx/xx/zz/releaseList"); request.setMethod("GET"); request.getHeaders().put("Authorization", "49ee2c7a-67b7-42cc-ad95-0ae05d25de42"); request.getHeaders().put("Content-Type", "application/json"); Spider spider = Spider.create(new MyPageHandler()) .addRequest(request) .addPipeline(new ConsolePipeline()) .thread(1); spider.getSite().addHeader("Authorization", "49ee2c7a-67b7-42cc-ad95-0ae05d25de42"); spider.run();
自己写了一个download 直接使用hutool的请求工具类直接执行: HttpResponse serviceProfile = HttpRequest.get(url).addHeaders(request.getHeaders()).execute(); 是可以正常有响应报文的,不知道啥情况?