/t5/coldfusion-discussions/cfc-uri-too-long-when-passing-text-string-to-cfc/td-p/935632Jun 26, 2008
Jun 26, 2008
Copy link to clipboard
Copied
I have a page that allows a user to save a large block of
text which is held within a <div> to the database without
reloading the page by way of cfajaxproxy and a cfc.
Upon clicking 'save' a javascript function pulls the block of
text out of the div and saves it to a javascript string, which is
then passed into a cfc by way of cfajaxproxy as a javascript
function parameter. (ie. functionName(theTextBlockString);). This
works just fine unless the text contained within that javascript
string var gets too long and causes a URi too long message.
Viewing the request in firebug I can see that the cfc is
called via a GET request, which causes all of my input parameters
that I've placed in the function to be placed in a GET url string,
so obviously when it is a long block of text the URL string gets
too long and I get the URi too long message from the CFC.
What I'm trying to figure out is how on earth I can pass a
large text string into the CFC without encountering this problem.
Is there an alternative request method so that I don't have to use
GET?
I found the setHTTPMethod parameter used when initializing a
cfc for cfajaxproxy - you can change it to POST which obviously
solves the problem. Adobe, make POST the default like CFAjax,
AJaxCFC, etc!!! Maybe theres some obscure reason to have GET
default, who knows...
/t5/coldfusion-discussions/cfc-uri-too-long-when-passing-text-string-to-cfc/m-p/935634#M85758Jun 30, 2008
Jun 30, 2008
Copy link to clipboard
Copied
LATEST
I found the setHTTPMethod parameter used when initializing a
cfc for cfajaxproxy - you can change it to POST which obviously
solves the problem. Adobe, make POST the default like CFAjax,
AJaxCFC, etc!!! Maybe theres some obscure reason to have GET
default, who knows...