Archives

Apex callout PATCH to Heroku Controller workaround

Setup a method to send Aync call to Heroku, add ‘?_HttpMethod=PATCH’ to the path to notify Heroku it’s a patch request Spring controller checks the RequestParam _HttpMethod to see if it’s a POST or PATCH request

Rate this:

Read More

Catch Apex Callout Loop not Allowed

Getting the following error: Apex Callout Loop not Allowed when you are doing a callout to the same Salesforce org and then calling out to another external service. In this case I was doing a callout to the same salesforce org and then doing a callout to the my logging service. Further you can write […]

Rate this:

Read More

Apex HttpCalloutMock DML workaround

When doing a callout it has to happen before the DML action. If it happens after the DML it will throw an error or will not execute. Workaround I used is to manually keep track of the mock response, and call the respond method to intercept Http.send when running a test. By checking for Test.isRunningTest() […]

Rate this:

Read More

Apex callout to RabbitMQ Queue

Create AMQP HTTPRequest calling POST /api/exchanges/{username}/{exchangeName}/publish Setup AMQP headers Serialize AMQP Request JSON Callout RabbitMQ

Rate this:

Read More