You need to sign in to do that
Don't have an account?
![Kaplan Elad Kaplan Elad](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Http Post Request error message
I'm testing a web service and when trying to make a callout, I'm getting an error message - System.HttpResponse[Status=Method Not Allowed, StatusCode=405].
I'm trying to call a test website "http://httpbin.org/ip" and this is my code :
String content = 'test';
Http m_http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('http://httpbin.org/ip');
req.setHeader('Content-Type','application/json');
req.setMethod('POST');
req.setBody(content);
httpResponse response = m_http.send(req);
system.debug('response : ' + response);
Anyone ?
I'm trying to call a test website "http://httpbin.org/ip" and this is my code :
String content = 'test';
Http m_http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('http://httpbin.org/ip');
req.setHeader('Content-Type','application/json');
req.setMethod('POST');
req.setBody(content);
httpResponse response = m_http.send(req);
system.debug('response : ' + response);
Anyone ?
you endpoint doesn't allow to execute post method. Try instead to use 'http://httpbin.org/post'.
Cheers!