Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请求本地服务 响应报:400 Bad Request #1162

Open
maskainv opened this issue Apr 22, 2024 · 0 comments
Open

请求本地服务 响应报:400 Bad Request #1162

maskainv opened this issue Apr 22, 2024 · 0 comments

Comments

@maskainv
Copy link

maskainv commented Apr 22, 2024

测试代码:
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();
是可以正常有响应报文的,不知道啥情况?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant