Hi After upgrading Spring Boot from 3.1.6/3.1.7 to 3.2.0/3.2.1, we're facing problems with the RestTemplate exchange method. Our API gateway pattern is encountering "BAD_REQUEST" responses, and we've noticed a peculiar issue with the POST HTTP method being printed as "Bad request Request method 'OST' is not supported."

This behavior was not present in the previous versions, and it seems linked to the recent Spring Boot upgrade. We've ruled out internal application discrepancies.

Could you please investigate and help resolve this issue? Let us know if you need more details or specific logs.

Comment From: mhalbritter

Hello,

do you use agent-based observability (like the OpenTelemetry agent)?

The API gateway is the one receiving the malformed responses? What exactly did you upgrade? The client, the server (the API gateway) or both? The client is using the RestTemplate, right?

Comment From: wilkinsona

Could you please investigate and help resolve this issue? Let us know if you need more details or specific logs.

I'm afraid not. We're a small team with limited bandwidth and we can't afford to spend time investigating a problem that we know very little about and that may not be caused by Spring Boot itself.

RestTemplate is part of Spring Framework. However, it only serves as an API on top of an underlying HTTP client library. If you're seeing problems at the HTTP level, the cause is most likely to lie in that library and that's where I think any investigation should begin. You haven't said which HTTP client you're using so I cannot make any further concrete suggestions. If you're using Apache's HTTP client, I'd probably start by enabling wire logging to check the requests that are being sent to verify that the client's really sending OST or if the problem's actually caused by request parsing on the receiving side.

Comment From: manjian14

We've identified a cross-platform issue after upgrading our API Gateway project from Spring Boot 3.1.6/3.1.7 to 3.2.1. The problem arises when making API calls from both desktop and mobile clients, resulting in "BAD_REQUEST" responses. Notably, the client headers differ between desktop and mobile.

Interestingly, the API gateway project, when running on 3.1.6/3.1.7, works seamlessly with other Spring projects already using 3.2.1. However, when upgrading the API gateway to 3.2.1, we start experiencing the reported issue.

It's worth noting that our API gateway implementation with clients has remained consistent since version 2.6.x, and we've successfully upgraded without encountering similar issues.

We appreciate your assistance in investigating and resolving this cross-platform compatibility issue. If more information or specific details are needed, please let us know.

Comment From: wilkinsona

Unfortunately, we don't have time to do that as there's no evidence that Spring Boot is the source of the problem.

Based on your latest description of the problem, it sounds like the investigation needs to begin with your API gateway that, reading between the lines, is built on Spring Boot and probably uses RestTemplate. Beyond that, we know nothing about it. Even if we had time, we would have no way to investigate the problem.

In addition to the logging suggestion above, you may want to try narrowing down the cause by overriding Spring Boot's dependency management. For example, does the problem occurs with Spring Boot 3.1.x if you manual upgrade dependencies such as Spring Framework or the HTTP client that you're using to their versions from Spring Boot 3.2.x? This investigation, that only you can do as no one else has the necessary information, will hopefully allow you to narrow down the cause of the problem and open an actionable issue with the relevant project.

Comment From: MherSaribekyan

Hello,

    @Bean
    public RestTemplate restTemplate(final RestTemplateBuilder templateBuilder) {
        templateBuilder.requestFactory((Supplier<ClientHttpRequestFactory>) HttpComponentsClientHttpRequestFactory::new)
                .setConnectTimeout(Duration.ofMillis(20000));
        return templateBuilder.build();
    }

this is our RestTemplate Bean, configured in sender service.

As RestTemplate.exchange method used HttpMethod as an enum, if we pass OST to this method, Enum creation will be broken, means somewhere POST is changed to OST in exchange flow.

Receiver service works with 3.2.1 version as well, when sender works with 3.1.7. There is no issue with receiver service!

Issue was duplicated on local host running!

Best Regards

Comment From: bclozel

@MherSaribekyan if you can replicate the problem with a minimal sample project just leveraging RestTemplate, please create a new Spring Framework issue. Ideally, your sample should be created with start.spring.io and send requests to public APIs like https://httpbin.org/. Please don't share a gateway-like project, the sample should focus on the client request that's causing issues.

Comment From: manjian14

@bclozel Thank you The API gateway issue revolves around the sender (Spring Boot 3.1.7) exchanging client-side requests with the receiver (Spring Boot 3.2.1). we will collect more information about the issue and share it with the Spring framework team since the exchange method belongs to their framework and the issue is easy to duplicate locally with a sample project