PUT requests

are there any extra configuration tricks required with apache to
handle PUT requests via SES urls?

I'm just not seeing the FORM variables in the rc scope? or in the FORM
scope for that matter

they show in the chrome debugger from the AJAX call

using CF8, I tried both trunk and 3.0 versions of coldbox

I've been thru the archives and seen a few discussions but nothing that helped

z

Hmm not that I know off. Should be pretty standard for put requests

Luis Majano
CEO
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano

I may have an interceptor that helps with this but wont be able to send the code until Sunday night or Monday. I had problems with some REST libraries for iOS that didn't properly pass the variable using PUT

Nolan Dubeau

Load *.*,8,1

Hi Nolan,

any luck on sending thru that interceptor?

zz

Hey Zac,

Apologies for the delay. I can’t take full credit for this as it was actually Luis that helped me tackle the same issue with the PUT requests. Hopefully this helps.


component output="false" extends="coldbox.system.interceptor"{

	/** 

	* Append HTTP request content to ColdBox request collection

	*/

	function preProcess(event,interceptData){

		var rc = event.getCollection();

			rc.contentString = event.getHTTPContent();

			//create structure to set name value pairs

			var inMap = {};

			//get HTTP request content

			try{

			if(!isBinary(rc.contentString)){

			// loop through each iteration and create name value pairs

			for(var x=1; x lte listLen(rc.contentString, "&"); x++){

				nameValuePair = listGetAt(rc.contentString,x,"&");

				inMap[getToken(nameValuePair,1,"=")] = urlDecode(getToken(nameValuePair,2,"="));

			}

			//append to request collection
			event.collectionAppend(inMap);

			}

			}
			catch(Any e){

				results.error = true;
				results.messages = "Error in REST Interceptor Pre-Process: #e.detail# #e.message#";

				if( log.canError() ){

					log.error(results.messages,e);
				}

			}

		}

}

Nolan

thanks for that!

should it be also checking if it's a PUT request?

z

You could add some logic for that yes, however I just left it for all requests. Did it solve the issue?

Nolan Dubeau

Load *.*,8,1

it's all working perfectly, thanks guys