Questions tagged [http]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
21
votes
2answers
10k views

How can I make a PATCH HTTP Callout from Apex?

I need to make a PATCH http request. I made the rather incredible discovery today that I can't set an HttpRequest to use the PATCH method, as when sending the request I get a callout exception: ...
15
votes
2answers
13k views

PATCH request using Apex HttpRequest

I'm looking for a way to create an HttpRequest in Apex using a POST method. When I do it, I hit this error: { "message": "HTTP Method 'POST' not allowed. Allowed are HEAD,GET,PATCH,DELETE", "...
20
votes
3answers
4k views

AWS Signature (version 4) in Apex

Over the past few days I have been struggling to create the AWS signature version 4 in Apex to send a request via query string, I have followed the step-by-step instructions for signing aws requests, ...
-1
votes
1answer
128 views

Wrapper class in Http getmethod

below is my code Created a wrapper class like below public class ResponseWrapper{ public list<Account> lstaccounts; public boolean isError ; public string errorCode; public ...
12
votes
1answer
1k views

Managed package callout invoked from managed package extension causing test class failure

We have a managed package that has executes a HTTP callout from a trigger that calls a future method on the insertion of new records on a particular object. We have a managed package extension that ...
5
votes
1answer
3k views

Is it possible to read cookie while doing a HTTP Get to external website?

Well was wondering if this is possible at all ? The aim is to get a cookie from an external website. But while going through the HTTP class for both Request and Response I don't think there is a ...
0
votes
2answers
623 views

Multiple Http Mock Callouts in a single test class

Hi so I'm trying to make a test class for my http callouts class. Now the problem is that I understand that I cannot make multiple DML and HTTP callouts in a single transaction but the third party API ...
17
votes
1answer
8k views

HttpCalloutMock Interface where there is more than 1 callout

Here is some background- I have an apex future method which is being called from an trigger. The future method then performs 3 different http calls to an external system (same endpoints). All requests ...
10
votes
1answer
6k views

apexrest: controlling HTTP error codes on exceptions

Is it possible to control what HTTP error code apexrest returns when an exception occurs in the code? By default it returns a 500 error and a developer who's working on the system that's consuming ...
1
vote
1answer
2k views

Trigger to use HTTP callout and update record with the results

I have been trying to integrate Google Shortener API into my salesforce org. I wrote a class to make the call out, but am having difficulty bringing the value back into the record. I have a custom ...
1
vote
3answers
996 views

Using Batch APEX to generate template body dynamically with merge field values

I am using Amazon SES to send mails to the all opportunities using batch apex with the body of email template. I'm using the solution proposed in an answer to Using APEX to assemble HTML Letterhead ...
8
votes
1answer
799 views

HTTP Callout Problems in Pre-release

I am running the same code in two different environments and I am getting different results. I have the following code hitting the REST API exposed on StackExchange: Http httpQuestions = new Http(); ...
8
votes
2answers
3k views

Sending a blob from Salesforce in a HTTP request?

Documentation says we can't do this. So as the title says, is there a workaround to make this possible?
3
votes
1answer
820 views

Not full URL in Referer header in Visualforce since Spring '17

I have a Visualforce page and controller relying on the HTTP Referer header. ApexPages.currentPage().getHeaders().get('Referer') Before my org was upgraded to Spring '17 this returned e.g.: https://...