FluidSurvey API를 호출하려고합니다. POST 요청을 할 때 ... fluidSurvey에 요청을 게시하지만 JSON 응답을받지 못했습니다. 오히려 아무것도 반환하지 않습니다. 어떠한 제안??POST 요청이 Salesforce에 JSON 응답을받을 수 없습니다.
내 컨트롤러 코드
public class fluidSurvey{
public String tst{set;get;}
public String result{get;set;}
public PageReference chk() {
getData();
return null;
}
public void getData(){
String apiKey = 'xxxxxx';
String pwd = 'xxxxxx';
String u = 'https://app.fluidsurveys.com/api/v2/surveys/survey_id/responses/';
HttpRequest req = new HttpRequest();
Http http = new Http();
HTTPResponse res;
try{
req.setEndPoint(u);
req.setTimeout(2000);
req.setMethod('POST');
Blob headerValue = Blob.valueOf(apikey + ':' + pwd);
String authorizationHeader = 'Basic '+ EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setHeader('Content-Type', 'application/json');
req.setHeader('Content-Length','31999');
res = http.send(req);
tst= res.toString();
catch(Exception e){
System.debug('Callout error: '+ e);
System.debug(tst+'--------'+res);
}
}
}
와 에이펙스 페이지 코드는
<apex:page controller="fluidSurvey">
<apex:form >
<apex:pageBlock title="New Fluid Surveys API">
<apex:outputText value="{!tst}"></apex:outputText><br/>
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Submit" action="{!chk}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
과 API 문서 링크는 여기에 ..
적어도 하나는 얻습니까? 적어도 상태 또는 코드가 있으면 게시하십시오. 첫 번째 제안은 20000으로 시간 제한을 늘리는 것입니다. –
아니요. 아무 것도 얻지 못했습니다. 시간 제한을 늘 렸습니다.하지만 문제가 있습니다. – WiXXeY
디버그는 무엇이라고 말합니까? 조사 할 수 있도록 여기에 모든 디버그를 게시 할 수 있습니까? 나는 무엇인가 말해야한다. 그냥 조용히 충돌하거나 뭔가 다른 것을 할 수는 없습니다 ... –