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构建,它 ...
随机推荐
- 在SQL中number(16,5)中的16和5 及number( 5,-2)中的5和-2是什么意思?
在SQL中number(16,5)中的16和5 及number( 5,-2)中的5和-2是什么意思? 2018-06-04 19:23:24 xiaonan_IT 阅读数 3672 版权声明:本文 ...
- github下载慢,轻松提速教程
获取github的IP地址访问:https://www.ipaddress.com/ 网址 依次获取以下三个网址的IP github.comgithub.global.ssl.fastly.netco ...
- 【原生JS】自动渐变轮播
渐变主要是通过CSS3的动画实现. 只需给css中添加transtion动画时间加上JS设置指定图片透明度显示与消失即可实现渐变过程. 效果图: HTML: <!DOCTYPE html> ...
- 命名实体识别视频51cto
https://edu.51cto.com/center/course/lesson/index?id=402918 https://edu.51cto.com/course/18466.html
- [转载] 学会使用Web Service上(服务器端访问)~~~
http://www.360doc.com/content/10/0712/12/541242_38461863.shtml# 关于什么是Web Service,相信在很多地方都会有介绍.简单的讲,W ...
- Spring Security-利用URL地址进行权限控制
目的是:系统内存在很多不同的用户,每个用户具有不同的资源访问权限,具体表现就是某个用户对于某个URL是无权限访问的.需要Spring Security忙我们过滤. 参考:http://www.cnbl ...
- 51nod1327 棋盘游戏
远古大坑 神仙DP状态设计题 https://blog.csdn.net/white_elephant/article/details/83592103 从行的角度入手,无论如何都要状压 每列最多放一 ...
- 2018-2-13-win10-uwp-InkCanvas控件数据绑定
title author date CreateTime categories win10 uwp InkCanvas控件数据绑定 lindexi 2018-2-13 17:23:3 +0800 20 ...
- Java语言中使用OpenMP
从去年年中,开始学习Java,主要是维护公司用Java编写的服务器软件.目前,该服务器软件遇到一个问题,在下载大文件时,如果同时下载的用户很多, 服务器软件工作会出现异常,有的用户无法下载.服务器硬件 ...
- 2018-10-23-使用-Pandoc-把-Markdown-转-Docx
title author date CreateTime categories 使用 Pandoc 把 Markdown 转 Docx lindexi 2018-10-23 10:56:18 +080 ...