+ Start a Discussion
CloudConversionCloudConversion 

Controlling Sites-based HTTP Response?

Does anyone know how to programmatically control the VisualForce HTTP response based on an incoming HTTP post parameter?

 

For example:

 

 

<apex:page showHeader="false" contentType="text/xml" controller="HttpController" action="{!processRequest}"> 

<apex:outputPanel rendered="{!action='getmodule'}">
	<Response moduleVersion="3.0.1" schemaVersion="1.0.0" >
		<Module>
			<Platform>Force.com</Platform>
			<Capabilities>
			    <DownloadStrategy>ByModifiedTime</DownloadStrategy>
			</Capabilities>
		</Module>
	</Response>
</apex:outputPanel>
<apex:outputPanel rendered="{!action='getcount'}">
	<Response moduleVersion="3.0.1" schemaVersion="1.0.0" >
		<count>1</count>
	</Response>
</apex:outputPanel>
</apex:page>

 

Or, maybe we can control the XML output in the controller?

 

 

Thanks,

Jon

Jon Mountjoy_Jon Mountjoy_

That's a good question CloudConversion. I've just checked the Visualforce documentation and see no obvious way to handle response codes.  I did find this idea where you can vote...LMK if you find a solution..