• Benabus
  • NEWBIE
  • 0 Points
  • Member since 2013

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

I need to find out if the request that's calling a page is a POST request so that I can handle things only in a POST.  For example, in PHP you'd do something like

 

if(!empty($_POST))

{

//do some stuff with POST data

}

 

Is there a way I can do this in apex?

 

Thanks

I'm trying to make a simple request to an https page.  It's registered in the remote sites area.  The domain (treatytime.com) has a wildcard ssl certificate, so in theory, it and all subdomains would use that certificate.  I keep getting this error, though:

 

java.security.cert.CertificateException: No subject alternative DNS name matching bserrette.treatytime.com found.


At this point, I'm not doing anything fancy.  Just trying to return a string to get thingsn connected.  From my reading, this error shows up when you're trying to access the site through a different name, like an IP address or something, but that's not the case here.

 

This is my code:

 

       

HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setEndpoint('https://bserrette.treatytime.com');
Http http = new Http();
HTTPResponse res = http.send(req);
return res.getBody();

 

 

Any help would be greatly appreciated.

Hi all,

 

So my ultimate goal is to take a document that has been uploaded to salesforce and programatically send that file via a post request to an external server to do some parsing on it.

 

Sending regular posts is relatively simple.  Is it possible to do this with a file?  I'm relatively new to apex.

 

Thanks.

I need to find out if the request that's calling a page is a POST request so that I can handle things only in a POST.  For example, in PHP you'd do something like

 

if(!empty($_POST))

{

//do some stuff with POST data

}

 

Is there a way I can do this in apex?

 

Thanks