I added the following VF page
<apex:page standardController="Account" extensions="createaccount" title="Test">
<apex:outputText value="{makePostCallout}"/>
</apex:page>
this is my apex class
public class createaccount {
public static HttpResponse makePostCallout() {
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://xxxxx.azure-api.net/xxxxxxxxx');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
// Set the body as a JSON object
request.setBody('{{"system_id": "xyz"}}');
HttpResponse response = http.send(request);
// Parse the JSON response
if (response.getStatusCode() != 201) {
System.debug('The status code returned was not expected: ' +
response.getStatusCode() + ' ' + response.getStatus());
} else {
System.debug(response.getBody());
}
return response;
}
}
in the developer console, I get the error
unknown constructor
Also When I go to create a custom button in Account object, I do not see this appearing in the drop-down list