service mesh的linkerd的postman测试问题
2018-02-26 11:11
381 查看
测试linkerd的服务时使用postman会出错,解析不到正确的host
协议是http,curl,java用unirest模拟http(和postman相同的参数,代码也是postman生成的)都行,就是postman不行(No hosts are available for /svc/localhost:4140)
协议是http,curl,java用unirest模拟http(和postman相同的参数,代码也是postman生成的)都行,就是postman不行(No hosts are available for /svc/localhost:4140)
public static void main(String[] args) throws Exception{ HttpResponse<String> response = Unirest.get("http://localhost:4140/") .header("GET", "/6767 HTTP/1.1") .header("cache-control", "no-cache") .header("host", "web") .header("postman-token", "4def4acc-61ad-d443-9ce5-52a3df3db501") .asString(); System.out.println(response.getBody()); }
curl -H "Host: web" http://localhost:4140/[/code]
后来google发现,原理是postman会屏蔽一些header的修改,在get时,设置header(Host:web)没有起作用。需要安装postman interceptor或者打开postman interceptor开关,这时设置的header才能起作用
查找结果:
Override the ‘Host’ header #781
Interceptor extension 下面Restricted Headers
enjoy service mesh!
相关文章推荐
- 使用Postman进行开发测试遇到的安装问题
- spring AOP 配置事务不起作用的问题(用Junit测试service)
- 问题.NETwebservice其他电脑无法使用-测试窗体只能用于来自本地计算机的请求
- 测试你的Service
- Selenium测试Ajax应用程序中的主要问题
- 广州测试沙龙的问题。
- 奇怪的Timer Service问题。
- 简单方便的api接口测试工具:Chrome浏览器插件postman
- junit测试在mysql生成表出现的问题及解决
- Windows搭建测试RabbitMq遇到的问题
- 测试中常遇到的问题
- 关于ScheduledExecutorService执行一段时间之后就不执行的问题
- Android自动化测试中AccessibilityService获取控件信息(1)
- 接口测试工具---postman下载地址
- 问题驱动的软件测试设计:架构与过程
- 解决Xcode 9.2系统真机测试时出现 could not find developer disk image问题
- 处理压力测试中的问题
- 关于IT测试中的一些问题。
- mybatis+springmvc测试出现的奇怪问题
- 在Windows下测试Apache遇到的80端口占用问题