• Saiprasad Kyatam
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies

Can I set my own response headers besides cache and content-type for an <apex:page> or any other pages on the force.com platform?

 

I'd be interested in setting my own headers in general but in this instance I'm trying to proxy a download of a JSON document through Apex with some modifications before it's passed off to the client.

 

I can return the text just fine and force it to download by modifying the Content-Type but without the Content-Disposition header, I can't set the filename which is a non-starter in my case. If I can't get Apex / VF to do this I'll have to setup a proxy outside of Salesforce.

 

Thanks!

  • March 11, 2011
  • Like
  • 0

I've been pouring over the docs and forums but haven't been able to determine if there's a way to set the http response code on a call to a visualforce page.

 

For example, I'd like to return 500 if I encounter an error in my Apex code and 200 if everything works.

 

 

Thanks,