We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [http]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
21
votes
2answers
9k 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: ...
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, ...
18
votes
2answers
18k views

String length exceeds maximum: 6000000

Are there any work arounds for this issue? I'm trying to upload a file(attachment) to an 3rd party REST API Service. It works fine until my file sizes get about ~5 mb. Then I start getting the ...
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 ...
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", "...
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 ...
11
votes
3answers
3k views

How to use HTTPGet variable in URL (ExactTarget)?

Been trying to figure out a way to pass in the variable into a HTTPGet function for long time now. How to do it? Here's what I have so far, but it doesn't return anything. <p id="date" style="...
10
votes
1answer
5k 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 ...
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?
8
votes
1answer
798 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(); ...
6
votes
1answer
8k views

What is the difference between webservice and HTTP service?

What is the difference between webservice and HTTP service? I have used HTTP service with REST api. But not able to understand what do we use webservice keyword and what is the difference between ...
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 ...
4
votes
2answers
3k views

Cannot find Data Extension by external key.

I am getting the response from https://www.exacttargetapis.com/hub/v1/dataevents/BBDD0F10-94A1-4CD6-B7A2-32FEB671E44F/rowset { "message": "Unable to locate data extension with ID bbdd0f10-94a1-...
4
votes
1answer
1k views

Calling custom apex as REST with XML results

So you want to call your Apex classes from outside salesforce via RESTful HTTP and need XML resurned even though it's uncool. The official documentation suggests it's supported by simply adding the ...
4
votes
1answer
1k views

Named Credentials - Merge Fields not Resolving

I am having an issue when attempting to reference the {!$Credential.UserName} and {!$Credential.Password} merge fields. I created a named credential with the following configuration: Identity Type:...
4
votes
0answers
267 views

OWASP Zap Report for scan Http request

Hi Friends , anyone heard about OWASP Zap Report ?? Scan request and response. i want create repohttps://eti-massemail.na24.visual.force.com/apex/MassEmail rt for one app of Salesforce. i face an ...
3
votes
1answer
3k views

Displaying web service response as HTML on VF page

I need to get html code from a web service and display it in a VF page. I've tried the following, but it's showing the response as text, not as html. VF <apex:page showHeader="false" sidebar="...
3
votes
1answer
806 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://...
3
votes
1answer
2k views

http post for mulitpart form

am trying to post the csv data through http post to end point url. Below is my code. string test = 'test1,test1@gmail.com'; // which will be get from DB and make as CSV string String ...
3
votes
1answer
205 views

HTTP call using Salesforce

I am trying to rewrite the following Java HTTP request in Salesforce. String apiUrl = "url"; String wsUser = "YourWSUser"; String wsPassword = "YourWSPassword"; CredentialsProvider ...
3
votes
1answer
11k views

HttpResponse body is empty even on successful request

I am doing a Http request to a web service and I get status 200 success. However when I try to read the response body (response.getBody()) it comes as empty. When I do response.toString() I get ...
3
votes
1answer
730 views

Anchors stripped from VF pages in server-side redirects?

I'm unable to get a VF page to load with an anchor in the URL if I redirect server-side. After clicking a button, I'm doing a DML operation and redirecting to a VF page. In the redirect, I'd like to ...
3
votes
1answer
2k views

Trapping “Maximum size of callout request or response” exception

Salesforce limits: "Maximum size of callout request or response: 3MB", is there a way to "trap this exception", to gracefully handle responses that end up being over 3mb? I'm hitting these limits and ...
3
votes
1answer
469 views

Multipart Post to Attachment

I am trying to send a binary file in Java to Salesforce '/sobject/Attachment' endpoint. Below is the code I am trying to use, but I keep receiving a 400 error. Any idea as to what the solution is? ...
3
votes
1answer
316 views

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out in test class

I am facing this issue in a MockCallOut for http in test class. I know that a dml is not allowed just above the callout, so I have tried to put callout between Test.startTest() and Test.StopTest(); I ...
3
votes
1answer
373 views

calling a salesforce HTTP method from iOS

How can I call a method in Salesforce from iOS? I am wanting to call submitToIntegration(application__c app) : public without sharing class blogic_Application { public static boolean ...
3
votes
1answer
410 views

How to get google adwords reports in salesforce?

Hi I am developing application in salesforce for accessing the google adwords reports data for e.g. ADGROUP_PERFORMANCE_REPORT. I am sending http post request to https://adwords.google.com/api/adwords/...
3
votes
1answer
394 views

Moodle API Request Works Everywhere But Apex

I have configured Moodle in all ways to receive API calls, and am able to make successful API calls from Postman, the address bar of any web browser, etc., but am having an issue translating it into ...
2
votes
2answers
955 views

TLS version and HTTP supported in production

We have not activated the update 'TLS1.1 for HTTPS' in our production org. So which version of TLS are right now supported by it? I mean does it support only TLS1.0 or it would support TLS 1.1? And ...
2
votes
1answer
1k views

Iframe won't load on Salesforce1

All I'm trying to do is load an iframe on a click on the main image and then a click on the header of the iframe reloads the main image. However, this isn't working on Salesforce 1 becuause: [...
2
votes
2answers
604 views

Perform crazy SOAP invocation using HTTP GET

Some REST endpoints do support the use of _HttpMethod override parameter: If you use an HTTP library that doesn't allow overriding or setting an arbitrary HTTP method name, you can send a POST ...
2
votes
1answer
135 views

REST GET API response does not contain null fields

I have written a REST API endpoint for Account object for GET operation. The code is below - @httpget global static list<Account> doget(){ RestRequest req = RestContext.request; RestResponse ...
2
votes
1answer
685 views

HTTP/ JSON Response - Developer Console

I'm trying to access an object that it is part of an HTTP JSON Response, this one. What I want is to access only the location object from that response. If I access the full response from the ...
2
votes
1answer
3k views

How to perform a DML insert after HTTP Callout (save a log of the response)

After reading the information around the issue Call error: System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out I tryed everything, like moving my ...
2
votes
1answer
280 views

What is http status code for API_DISABLED_FOR_ORG

I am debugging an issue with calling salesforce API and I need to know what is the http response status code for : "message":"The REST API is not enabled for this Organization.","errorCode":"...
2
votes
1answer
483 views

Twitter Integration getting error Failed to validate oauth signature and token

i am trying to implement twitter authorization in my salesforce app.in first step i am trying to get request token from twitter.here is my code : public String getTwitterReqToken(){ ...
2
votes
2answers
5k views

“message”:“INVALID_HEADER_TYPE”,“errorCode”:“INVALID_AUTH_HEADER” received

I am trying to call a rest resource within the same org (Because I am inserting records of an object developed by 3rd party and they strongly advised us to not do any DML directly rather they have ...
2
votes
1answer
1k views

Patch Method http callout from apex [duplicate]

I must use this patch http callout. Is any one has idea? http://developers.goformz.com/docs/update-an-existing-data-source-1 I get error "Invalid HTTP method: PATCH" Exception. In our project ...
2
votes
1answer
576 views

Salesforce and CURL

I am a new Salesforce developer. I got an assignment where I have to get connected to an API using developer_id;developer_key The documentation says, Developer authentication involved sending a ...
2
votes
1answer
498 views

How do you find the Jitterbit Harmony Http HostedEndpoint SERVERNAME & PORT combination?

I'm sending an outbound message from SFDC to Jitterbit. The Jitterbit "NO-Cumentation" http://support.jitterbit.com/documentation/How-to-Create-a-Hosted-HTTP-Endpoint states: ... "the end-point ...
2
votes
0answers
59 views

Fetch Data of Different Organization?

I have 2 Orgs- Org A & Org B both are ap1 Instance In Org A I've created a Connected app In Org B I am trying to Query accounts of Org A From the Connected App Through Http Call, but I am ...
2
votes
2answers
198 views

Loading HTTP resource in Visualforce pages

Is there a way to allow loading of non secure resources from external sites in Visualforce pages? Below is the scenario I have. I am creating a force.com site page. The template I received for the ...
1
vote
1answer
60 views

SSJS HTTP Get method error - Unable to retrieve security descriptor for this frame

I am trying to retrieve a template-based email asset using the Content Builder API via a Cloud page. I am having trouble retrieving the template. I am not sure if it is an issue with the structure of ...
1
vote
1answer
571 views

405 response code when trying to callout to Google

Here is my code for callout. Http http = new Http(); HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); req.setEndpoint('https://google.com?q=...
1
vote
2answers
417 views

Uncommitted work pending from a non-DML access

I'm trying to upload documents to a third party server. This is what I've come up with currently. I got several methods to preprocess the upload process and after that I run a loop to upload the files....
1
vote
1answer
3k views

while calling Apex REST class, getting response “Could not find a match for URL /CallREST1”,“errorCode”:“NOT_FOUND”}]"

here is my APEX REST class code @RestResource(urlMapping='/CallREST1') global with sharing class CallREST { @HttpPost global static String createNewCase(String companyName) { ...
1
vote
3answers
144 views

Make http callout in batch after insert actions

I have a batch job with http callout enabled, in the execute() method, the code logic goes like: global void execute(Database.BatchableContext BC, List<Object> scope){ List<CustomObject&...
1
vote
1answer
353 views

Http request not returning token through Apex

I am trying to communicate with an API through Apex, the parts of the API I wish to access require an access token acquired using OAuth 2.0. I have created a method that will access the endpoint and ...
1
vote
1answer
914 views

Process Builder Outbound Message

I know that we can not send a Outbound message using process builder, However we can have a workaround to invoke an apex method which calls send the http callout as explained here: https://...
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 ...