tag:blogger.com,1999:blog-238133977370050645.post276259646502963004..comments2024-03-28T17:03:54.645+05:30Comments on Salesforce Stuff: Different ways of testing HTTP callout in apexSunil Kumarhttp://www.blogger.com/profile/09681895934176598302noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-238133977370050645.post-56547939547584259962024-01-15T13:47:12.737+05:302024-01-15T13:47:12.737+05:30Buy winter clothes for women at the best prices on...Buy <a href="https://jazmin.pk/collections/unstitched-winter" rel="nofollow">winter clothes</a> for women at the best prices online in Pakistan. Discover the latest winter clothing dress from Jazmin online. Start your online winter shopping now.Jazmin Clothing Brandhttps://www.blogger.com/profile/11177684053373790147noreply@blogger.comtag:blogger.com,1999:blog-238133977370050645.post-9540191842207316032024-01-14T19:52:52.805+05:302024-01-14T19:52:52.805+05:30Discover the exquisite world of luxury dresses by ...Discover the exquisite world of luxury dresses by Ammara Khan. Explore the finest <a href="https://www.ammarakhan.com/collections/luxury-formals" rel="nofollow">Luxury Formals pakistan</a> collection and indulge in the opulence of luxury clothes.Ammara Khanhttps://www.blogger.com/profile/17234964365003962736noreply@blogger.comtag:blogger.com,1999:blog-238133977370050645.post-35720122437867724782024-01-13T17:50:25.562+05:302024-01-13T17:50:25.562+05:30Discover the latest men winter collection by Ahmad...Discover the latest <a href="https://ahmadshahjahan.com/collections/al-shita" rel="nofollow">men winter collection</a> by Ahmad Shahjahan. Shop high-quality and affordable prices for unstitched fabric to create a perfect winter wardrobe.Ahmad Shahjahanhttps://www.blogger.com/profile/09384744485670223668noreply@blogger.comtag:blogger.com,1999:blog-238133977370050645.post-66008130997207483682024-01-12T17:19:42.620+05:302024-01-12T17:19:42.620+05:30Find the perfect hoodies for women in Pakistan wit...Find the perfect <a href="https://www.nayza.com/collections/women-jacket-hoodie" rel="nofollow">hoodies for women</a> in Pakistan with Nayza. Explore a wide range of stylish designs and trendy options for women's jackets. Shop now to stay warm and fashionable.Nayzahttps://www.blogger.com/profile/12807995079138881383noreply@blogger.comtag:blogger.com,1999:blog-238133977370050645.post-39755326525069070872017-04-11T12:39:01.628+05:302017-04-11T12:39:01.628+05:30Any help for testing this code?
******************...Any help for testing this code?<br />*************************8<br />global with sharing class NavikUtilityClass {<br /> global Static HttpResponse callSendToNavikAuthentication(String endURL,String methodType,String methodFunctional,String accNum, String contact, String recommendation,Integer dataId,List input,List dataIds) {<br /> String baseUrl = EndPoint__c.getvalues('BaseURL').EndPointURL__c;<br /> navikAuthDomain.response mapResp = navikAuthentication.getMapId(UserInfo.getUserEmail());<br /> Http http = new Http();<br /> HttpRequest request = new HttpRequest();<br /> request.setHeader('sessionToken',mapResp.sessionToken);<br /> request.setMethod(methodType);<br /> if(methodFunctional == 'ACTIVITY'){<br /> request.setEndpoint(baseUrl + '/' + endURL);<br /> }<br /> if(methodFunctional == 'DRILLDOWN'){<br /> request.setEndpoint(baseUrl + '/' + endURL);<br /> String accNo = EncodingUtil.urlEncode(accNum,'UTF-8');<br /> String cont = EncodingUtil.urlEncode(contact,'UTF-8');<br /> String recom = EncodingUtil.urlEncode(recommendation,'UTF-8');<br /> request.setBody('accountNumber='+accNo+'&contact='+cont+'&recommendation='+recom);<br /> }<br /> if(methodFunctional == 'SPECIFICRECOMM'){<br /> request.setHeader('content-type', 'application/json');<br /> request.setHeader('Accept', 'application/json');<br /> request.setEndpoint(baseUrl + '/' + endURL);<br /> request.setEndpoint(baseUrl + '/'+endURL+dataId);<br /> }<br /> if(methodFunctional == 'SENDEMAIL'){<br /> request.setHeader('content-type', 'application/json');<br /> request.setHeader('Accept', 'application/json');<br /> request.setEndpoint(baseUrl + '/' + endURL);<br /> String s = JSON.serialize(input);<br /> request.setBody(s);<br /> }<br /> if(methodFunctional == 'INVALID'){<br /> request.setHeader('content-type', 'application/json');<br /> request.setHeader('Accept', 'application/json');<br /> request.setEndpoint(baseUrl + '/' + endURL);<br /> request.setBody(JSON.serializePretty(dataIds));<br /> }<br /> HttpResponse response = null; <br /> try {<br /> response = http.send(request);<br /> } catch(System.CalloutException e) {<br /> System.debug('Callout error: '+ e);<br /> System.debug(response.toString());<br /> } <br /> return response; <br /> } <br />}Anonymousnoreply@blogger.com