Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [http]

The tag has no usage guidance.

1
vote
1answer
39 views

Attempting to pass parameter in request.setEndpoint URL & call through Einstein chat-bot! Is this correct code?

I want to concatenate 'input' variable in the Endpoint URL. If i am passing hard-coded value like 'London', its working properly.(I am getting weather in JSON format back). I want to do it dynamically....
0
votes
0answers
16 views

How to make HttpGet sending faster and lighter for junction objects?

I have Obj Kid__c and Obj Toy__c with junctions between them. Many-to-many. In junction obj are just Id of Kid__c and Id of Toy__c. I have HttpGet service and Callout which I get Kid__c records from ...
0
votes
2answers
27 views

What's wrong with my Batch Apex + Http callout get method?

I think my code is wrong. Last version of my HttpGet/Callout code (it works): How to use HttpGet service to get a list of objects and create them? Now I try to make it batch. My Execute Anonymous ...
0
votes
1answer
107 views

External image not displaying in community

My problem is that I cannot view an image loaded from an external site into an img tag in my lightning component. The URL is with 'http' protocol not 'https', but when I see the Chrome Console, it ...
0
votes
2answers
66 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 ...
1
vote
1answer
578 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 ...
0
votes
1answer
30 views

Not able to create incident from salesforce to servicenow

I tried the following code to insert incident from salesforce to ServiceNow but not sure what I am doing wrong here, Can anyone guide me what changes needed in this code or do I need to create ...
1
vote
2answers
92 views

HTTP Callout Error using form data format

I am posting the data to endpoint url through http callouts from developer console and getting response "200 ok" and in body of response i am getting an error message of "{"IsSuccess":false,"Message":...
0
votes
1answer
71 views

Convert Multile Objects to a single json

I have a list of map and list objects. These objects needs to be sent as json content in an http request. The objects are Map<String,String> leftFileParameters = new Map<String,String>()...
-2
votes
1answer
45 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 ...
1
vote
0answers
98 views

HTTP GET failing

I have an activity script running a SSJS HTTP GET request. I need to get the output of this request to feed a data extension. I am using this code: var de= DataExtension.Init("dataextension_ek"); ...
0
votes
1answer
210 views

Error while uploading File to S3 from Apex

I am using the below code to upload file to Amazon S3 from Apex class. public void uploadToAmazonS3 () { String filename = this.record.File_Name__c; String attachmentBody = EncodingUtil....
-2
votes
1answer
89 views

Test class for Http Request [duplicate]

I need test class for the below class i have for code coverage. Please help. class and its code is public CodeCoverageController(){ HttpRequest request = new HttpRequest(); ...
0
votes
1answer
23 views

Creating REST Api with little control over request structure

I'm trying to expose a method to be accessed through HTTP Post. @RestResource(urlMapping='/exampleURL') global with sharing class Listener { //Object jsonObj = JSON.deserializeUntyped(...
0
votes
1answer
60 views

Pass value to a visualforce controller from a HTTP Post

I have an iframe that uploads video recordings to a server, when the recording is complete we receive back a call telling us that the video has been uploaded, I am trying to expose a notification on ...
1
vote
1answer
198 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 ...
-3
votes
1answer
48 views

Perform DML over HTTP classes [closed]

How to insert, update... records by using the HTTP classes? I need to insert and delete records over an apex controller by using HTTP classes. I need to do it over HTTP because the DML has to be ...
1
vote
1answer
36 views

on Post -System.CalloutException on one object but not on another

I'm building an application which sends a post request to an endpoint when a particular record is inserted. The trigger looks like this(for testing purposes): trigger NotifyPlayersOfShowCancelation ...
0
votes
0answers
342 views

Callout in test method not returning mock response

I am trying to write a test class for testing an HTTP callout. Test class compiles without errors. However, I am not getting the mock response inside. Below is the relevant parts of my code. ...
1
vote
0answers
35 views

StripeForce addLineItem is not working

I have a task using the StripeForce Stripe Client. I've been trying to do the following. Once an invoice is created on stripe, to use the webhook invoice.created and then add a line item to the ...
2
votes
1answer
426 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 ...
0
votes
0answers
170 views

Test class code coverage for catch block in httprest api

below is my class code. code is not getting covered for the catch block. current code coverage is 75%. Also given below is my test class code. In need at least 90%. public class ...
1
vote
1answer
557 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://...
2
votes
1answer
2k 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 ...
0
votes
1answer
253 views

cover httpRespone and if condition in test class

while calling method @isTest public class call_Test{ static testMethod void unitTest(){ uptodel.qTis(); } } its given error that Methods defined as TestMethod do not support Web ...
0
votes
1answer
63 views

Default values for variables not set when creating new HTTPRequest?

If you create a new HTTPRequest and don't specify a header, what does it default to when you send it using Http.send()?
1
vote
2answers
260 views

On iPad Safari Dev Tool Getting Error “Refused to execute JavaScript URL”

Over the weekend the following formula field building a link stopped working on iPad. IF (ShowCustomLink__c, HYPERLINK("/apex/MyVfPage?id="&Id + "&var1=val1" + "&var2="&Name, IMAGE("/...
0
votes
1answer
132 views

unauthenticated Visualforce page through sites - https access

I have exposed a visualforce page to non-salesforce users using sites. This site is accessible using http and no login is required. How can I make this site accessible using https ?
2
votes
1answer
611 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://...
1
vote
1answer
738 views

use org session id for salesforce rest api call to get records

I'd like to make a rest api call from within my org. From the docs "You can use a session ID instead of an OAuth 2.0 access token if you aren’t handling someone else’s password:" in my VF page I use ...
1
vote
0answers
119 views

PHP Toolkit to SF API, Why am I getting a 402 error with “Unable to determine from which page the request originated”?

I am attempting to build a set of tools in PHP designed to "smoke text" various data transmissions to and from our Salesforce org, using PHP Toolkit 20.0. Here is my PHP: require_once('soapclient/...
3
votes
1answer
290 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 ...
4
votes
1answer
735 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:...
3
votes
1answer
281 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? ...
2
votes
2answers
715 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
827 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 ...
0
votes
1answer
533 views

Consuming External Rest API in apex

I have a requirement where I have to consume external REST API. I have the URL for the same and the values for the parameters to be passed to get a response XML from the service. I am not getting how ...
0
votes
2answers
107 views

pass string value

In the Below requeststring, I have to pass one value from the post form data. For e.g: I have a user name text box and I need to pass that user name value on form submission in the below request ...
1
vote
1answer
1k 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
0answers
39 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 ...
0
votes
1answer
133 views

End Point URL Error in HTTP Class?

I have a 3rd Party Endpoint Url Which I Paste in browser Address bar I can see the XML Data. But the same Endpoint URL , I invoke via Apex Class (Http Call) I will get a Error Message From the System ...
3
votes
1answer
200 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 ...
0
votes
1answer
643 views

HTTP Post with redirect

So, I've got a HTTP Post that I am doing with two parameters. I'm not receiving any sort of session ID back to help me with the URL redirect. Apparently it is more of a 'post to this' and you're in. ...
2
votes
1answer
472 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 ...
0
votes
1answer
193 views

Apex Batch Reduce Callout Process Time

From batch class we are able to connect to third party API 5times per second on an average, i am wondering is there any way to increase the callouts per second. I am sure there may be chances
1
vote
1answer
204 views

Use an http right frame instead of https on Login page

I wish to use an http right frame instead of https for my login page. However, it shows me, unable to do so as the website is http. Is there a way to add our right frame on the login page?
1
vote
1answer
1k views

Does HttpRequest.setClientCertificateName always send a certificate?

We are trying to use certificates to authenticate the client (Sales Force) calling our back-end system. However, as far as we can see, SalesForce is not sending any certificate. HttpRequest req = new ...
1
vote
0answers
63 views

Asychronous call to wordpress using HTTP callout failing due to timeout

Timeout error with Asychronous HTTP callout to wordpress site I am trying to make an asynchronous call to a wordpress site using HTTP callout method( using @Future). Everything works on sandbox and I ...
1
vote
1answer
402 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=...
0
votes
1answer
73 views

Pull specific content from HTTPGET request

Is there a way to only grab specific content from an HTTPGET request? For example, if the content I need for the email is contained within the <div id="the_content"> tag. <html> <...