cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Pass Large String to Action/Function in CAP Java

LiaoAlex
Associate
Associate
0 Likes
247

I define an Action in CDS view within CAP Java Framework.

action testorchestrate(sysmessage:String, usermessage:String, image:String) returns String;

Then I access the API like below:

POST /testorchestrate

{
"sysmessage": "you are an assitant",
"usermessage": "what you see",
"image":  ...long string
}
 
It returns error, how to deal with this issue?

Message Request header is too large

Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

Exception

java.lang.IllegalArgumentException: Request header is too large
	org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:777)
	org.apache.coyote.http11.Http11InputBuffer.parseHeader(Http11InputBuffer.java:971)
	org.apache.coyote.http11.Http11InputBuffer.parseHeaders(Http11InputBuffer.java:592)
	org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:293)
	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905)
	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
	org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	org.apache.tomcat.util.threads.TaskThread$Wrappin

Accepted Solutions (0)

Answers (0)