Skip to main content
Inspiring
January 14, 2015
Question

Getting status Pending when calling rest function call

  • January 14, 2015
  • 0 replies
  • 529 views

Hi,

Coldfusion version 10.

The app hangs using IE9 when I do a REST cf function call from js file. Observing the console, I see Pending status. However, it works fine in later versions of IE, Chrome and Mozilla.

When I changed cffunction httpmethod from DELETE to PUT it worked. So, I figure that maybe javascript function call and cffunction header mismatch.

------------------------------------------------------------------------------------

Here is cffunction;

<cffunction output="no" name="zeroUpdateCredits" access="remote" produces="application/json" consumes="application/json" returnType="struct" httpmethod="DELETE">

<cfargument name="DATA" type="struct" required="yes"/>

<cfset var retStatus = StructNew() />

<cfset retStatus["success"] = true />

<cftry>

<cfset var qSponsDetails = APPLICATION.cfc.properties.getsettings(DATA.employee_id)>

<cfif qSponsDetails.allow_credits>

  <cfset temp = saveCredits(credits = 0, employee_id = DATA.employee_id, effective_date = DATA.effective_date)>

</cfif>

<cfcatch type="any">

<cfthrow errorcode="401" message="error zero credits" />

<cfreturn>

</cfcatch>

</cftry>                  

<cfreturn retStatus>

</cffunction>

----------------------------------------------------------------------------------

Here is the function call:

exports.clearCredits = function(employeeId, effectiveDate){

data = {

  employee_id: employeeId,

  effective_date: effectiveDate

};

var promise = rest.DELETE({

  url: appConfig.restPrefix + 'selections/unusedcredits?t=' + new Date().getTime(),

    contentType: 'application/json'

  }, JSON.stringify(data)

  );

  return promise;

};

Thank you,

Gena

This topic has been closed for replies.