I am constructing something wrong, in the POST request. Please advise.
Step 1: Created Named Credential called Stock_Check_For_Materials
Step 2: Created Apex Controller as below
Continuation con = new Continuation(40);
con.continuationMethod='processResponse';
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:Stock_Check_For_Materials/stockcheck');
req.setMethod('POST');
req.setHeader('Content-Type','application/json');
req.setBody('customerNumber='+EncodingUtil.urlEncode(cN, 'UTF-8')+'&requireGenericEquivalent='+EncodingUtil.urlEncode(rGE, 'UTF-8')+'&itemNumber='+EncodingUtil.urlEncode(itN, 'UTF-8')+'&orderQuantity='+EncodingUtil.urlEncode(oQ, 'UTF-8'));
this.requestLabel = con.addHttpRequest(req);
Please note that the 'customerNumber', 'requireGenericEquivalent', 'itemNumber' and 'orderQuantity' are the POST body for request and cN,rGE,itN,oQ are the getter and setter variable values coming from the visualforce page to this controller.