You need to sign in to do that
Don't have an account?
sbanu 9.3 Prod Sayeeda
Missing Content-Type HTTP header Error in smart Sync (Sync up method)
Hi ,
Am using Global Smart Store with Smart Sync Option.
Here am creating a Call ("Call" is a custom object) from iPad and storing it in smart store and trying to sync up.
But am getting an error from SyncUp method as failed. the error is
Sync type:syncUp id:157 FAILED cause:Server call for sync up failed error:Error Domain=CSFNetworkErrorDomain Code=400 "Missing Content-Type HTTP header" UserInfo={NSLocalizedFailureReason=INVALID_CONTENT_TYPE, isAuthenticationFailure=false, NSLocalizedDescription=Missing Content-Type HTTP header, action=<SFRestAPISalesforceAction: 0x7f9f86300000, POST "/sobjects/Call_ims__c" (0.00)>}
Am using Global Smart Store with Smart Sync Option.
Here am creating a Call ("Call" is a custom object) from iPad and storing it in smart store and trying to sync up.
But am getting an error from SyncUp method as failed. the error is
Sync type:syncUp id:157 FAILED cause:Server call for sync up failed error:Error Domain=CSFNetworkErrorDomain Code=400 "Missing Content-Type HTTP header" UserInfo={NSLocalizedFailureReason=INVALID_CONTENT_TYPE, isAuthenticationFailure=false, NSLocalizedDescription=Missing Content-Type HTTP header, action=<SFRestAPISalesforceAction: 0x7f9f86300000, POST "/sobjects/Call_ims__c" (0.00)>}
As per your error, seems that you are not specifying the Content-Type in request header while making the call out. Content-Type may be application/json, application/xml or any other that your API supports.
Also, you can paste your request so that I could help you more on this.
Let me know if this helps :)
Thanks,
Amit
am using a smart Store and adding below dictionary to Smart Store and then trying to do sync-Up.
{
"Account_ims__c" = 001F0000017FlswIAC;
"Address_Line_1_ims__c" = "1 BAY AVE";
"Call_Date_Time_ims__c" = "2017-01-31T09:31:00.000+0000";
"Call_Type_ims__c" = "Detail Only";
Id = "Call_ims__c-005F0000005Hlaa-20170124115946-83279";
"Status_ims__c" = Planned;
"__local__" = 1;
"__locally_created__" = 1;
attributes = {
type = "Call_ims__c";
};
}