You need to sign in to do that
Don't have an account?

Question regarding http request
Hi all,
I wanted to know if there any way to see the http request , for example basic http request , and i want to see the actual request that is sent from salesforce server
public void basicAuthCallout(){ HttpRequest req = new HttpRequest(); req.setEndpoint('http://www.yahoo.com'); req.setMethod('GET'); // Specify the required user name and password to access the endpoint // As well as the header and header information String username = 'myname'; String password = 'mypwd'; Blob headerValue = Blob.valueOf(username + ':' + password); String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue); req.setHeader('Authorization', authorizationHeader); // Create a new http object to send the request object // A response object is generated as a result of the request Http http = new Http(); HTTPResponse res = http.send(req); System.debug(res.getBody()); }
have a look at my response in below thread.
http://boards.developerforce.com/t5/Apex-Code-Development/Web-service-callout-failed-Failed-to-get-next-element/m-p/266455#M46438
Hope that helps.
Afzal
Thanks !
I understand that it support only POSt request , do you know if there is a difference between post to put
because my setmethods=PUT , ?
Another question , I noticed that salesforce add headers to my request is there a way to cancel those headers
Am not aware of any such difference, but am curious to know how it effects your implementation? Are you unable to send a http request, when you use PUT?
Afzal
When I am using the put I can't use the http://www.postbin.org. (because it work only with post )
Another question , I noticed that salesforce add headers to my request is there a way to cancel those headers