0

A Java server exposes REST services using Apache CXF 3.1.10. Trying to call a GET service with a URL longer than 8K, the service gives error.

The REST server uses JAXRSServerFactoryBean that launch a Jetty server. I can not find a way to allow the server to accept request of more than 8K.

Claudio Query
  • 323
  • 1
  • 4
  • 13

1 Answers1

0

Get requests have a query size limit, both on client and server side. (check this for details: maximum length of HTTP GET request?)

Maybe you should move to POST services. Or if you control both the client and server, you may use the request body. (That is allowed for GET requests but there are some clients/servers not supporting that)

xycf7
  • 913
  • 5
  • 10
  • Thanks for your suggestion, but it's not right to change the GET in POST because the failed service is a data request (https://www.w3schools.com/TAGs/ref_httpmethods.asp) – Claudio Query Aug 09 '17 at 12:17
  • Actually it is not exactly true. GET requests are expected to return data, so there should not be any side effect. But POST requests MAY update data. They are not forced to do that. POST could be used for data retrieval for multiple reasons, one of them is, the data being sent is too large to fit in the URL string. – xycf7 Aug 10 '17 at 01:32