0

I have below class which i need to test it from workbench/postman. I am not sure how should i test it .

@RestResource(urlMapping='/CheckAuth/*')
global with sharing class example1 {
 @HttpPost
 global static void doPost() {
    Http h = new Http();
    HttpRequest hr = new HttpRequest();
    hr.setEndpoint(IDENTITY_PROVIDER);
    hr.setHeader('X-OpenIDM-Username',username);
    hr.setHeader('X-OpenIDM-Password',password);
    hr.setMethod('GET');
    HttpResponse hrs = h.send(hr);
    RestResponse res = RestContext.response;
    res.addHeader('Content-Type', 'application/soap+xml');
    res.statusCode = 200;

}

where should i set passowrd and username ,what should my end url.please suggest

  • From where are you setting value to username and password variable? – Pranay Jaiswal Oct 15 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.