I'm trying to develop a Page that given some GET parameters would return HTTP Status 200 or status 400 depending on some inner query.
This would be really easy with a RESTful service, but we need this to be a Page.
How can I do this?
This is the page:
<apex:page controller="SimpleRequest" action="{!Success}">...</apex:page>
And this is the SimpleRequest class:
public class SimpleRequest {
public SimpleRequest(){}
public PageReference Success() {
Map<String,String> GET = ApexPages.currentPage().getParameters();
if (GET.isEmpty()) {
//return HTTP status code 400
}
return null;
}
}