curl使用post方式访问Spring Cloud gateway报time out错误
公司老的项目使用是php,要进行重构。其他团队使用php curl函数使用post方式调用Spring Cloud gateway 报time out错误。
但是使用postman测试是没有任何问题,php curl如果绕过网关直接访问接口也没有问题。结果发现了是因为:
使用Curl POST数据时,如果POST的数据大于1024字节,Curl并不会直接发起POST请求,而是分两步:
1、发送一个请求,Header中包含一个Expect:100-continue,询问Server是否愿意接受数据
2、接受到Server返回的100-continue回应后,才把数据Post到Server
这个也是Spring Cloud gateway一个Bug:https://github.com/spring-cloud/spring-cloud-gateway/issues/273
解决办法:配置路由转发的时候,去掉expect request Header
.route("openapi_route", p -> p.path(ORDER_CENTER_API + "/openapi/**").filters(f->f.removeRequestHeader("Expect"))
.uri("lb://order-xxxxx-service"))
curl使用post方式访问Spring Cloud gateway报time out错误的更多相关文章
- Spring Cloud Gateway报错:Unable to start embedded Tomcat
最近搭建Spring Cloud Gateway时启动项目出现如下报错信息: Error starting ApplicationContext. To display the conditions ...
- Spring Cloud Gateway服务网关
原文:https://www.cnblogs.com/ityouknow/p/10141740.html Spring 官方最终还是按捺不住推出了自己的网关组件:Spring Cloud Gatewa ...
- 网关服务Spring Cloud Gateway(一)
Spring 官方最终还是按捺不住推出了自己的网关组件:Spring Cloud Gateway ,相比之前我们使用的 Zuul(1.x) 它有哪些优势呢?Zuul(1.x) 基于 Servlet,使 ...
- 微服务网关实战——Spring Cloud Gateway
导读 作为Netflix Zuul的替代者,Spring Cloud Gateway是一款非常实用的微服务网关,在Spring Cloud微服务架构体系中发挥非常大的作用.本文对Spring Clou ...
- 跟我学SpringCloud | 第十二篇:Spring Cloud Gateway初探
SpringCloud系列教程 | 第十二篇:Spring Cloud Gateway初探 Springboot: 2.1.6.RELEASE SpringCloud: Greenwich.SR1 如 ...
- spring cloud:服务网关 Spring Cloud GateWay 入门
Spring 官方最终还是按捺不住推出了自己的网关组件:Spring Cloud Gateway ,相比之前我们使用的 Zuul(1.x) 它有哪些优势呢?Zuul(1.x) 基于 Servlet,使 ...
- Spring Cloud Gateway入门
1.什么是Spring Cloud GatewaySpring Cloud Gateway是Spring官方基于Spring 5.0,Spring Boot 2.0和Project Reactor等技 ...
- Spring Cloud Gateway重试机制
前言 重试,我相信大家并不陌生.在我们调用Http接口的时候,总会因为某种原因调用失败,这个时候我们可以通过重试的方式,来重新请求接口. 生活中这样的事例很多,比如打电话,对方正在通话中啊,信号不好啊 ...
- Spring Cloud Alibaba学习笔记(15) - 整合Spring Cloud Gateway
Spring Cloud Gateway 概述 Spring Cloud Gateway 是 Spring Cloud 的一个全新项目,该项目是基于Netty.Reactor以及WEbFlux构建,它 ...
随机推荐
- WPF Converter(转)
WPF Binding 用于数据有效性校验的关卡是它的 ValidationRules 属性,用于数据类型转换的关卡是它的 Converter 属性.下面是实例: 1. Binding 的数据校验 & ...
- ip地址库 与浏览器的关系
https://zhidao.baidu.com/question/325152705.html 只要手机连接数据上网就会产生ip,只要进入了淘宝,就能查出用户访问记录的. 手机是运营商动态分配的.它 ...
- div+css布局的好处
改版的时候更方便,只需改动CSS文件 页面加载速度更快,结构清晰,页面简洁 表现与结构相分离 有利于SEO,排名更靠前
- Python--day66--内容回顾
3,python中的大小比较和js中的大小比较规则: python中a>b>c,就是先比较a>b,然后再比较b>c,都为true的话就返回true: js中的a>b> ...
- Python--day41--条件
1,条件 #锁 #acquire release#一个条件被创建之初 默认有一个False状态#False状态 会影响wait一直处于等待状态#notify(int数据类型) 造钥匙 代码示例:条件. ...
- H3C 什么是OSPF
- JavaScript数据类型总结
1. 六种简单数据类型:Undefined.Null.Boolean.Number.String.Symbol(新增): 一种复杂数据类型:Object: (1)基本数据类型保存在栈内存中,是按值传 ...
- tensorflow在文本处理中的使用——skip-gram模型
代码来源于:tensorflow机器学习实战指南(曾益强 译,2017年9月)——第七章:自然语言处理 代码地址:https://github.com/nfmcclure/tensorflow-coo ...
- 2019-11-19-C#-高级面试题
title author date CreateTime categories C# 高级面试题 lindexi 2019-11-19 08:40:50 +0800 2018-11-12 11:18: ...
- CF1088F Ehab and a weird weight formula
CF1088F Ehab and a weird weight formula 推性质猜结论题 第一步转化,考虑把点的贡献加到边里: $con=\sum (log_2(dis(a_u,a_b))\ti ...