You need to sign in to do that
Don't have an account?

Why can't call a httppost of Rest API?
Apex calss:
I call Rest API from android:
@HttpPost global static Integer checklogin(String email, String password ) { List<AccountUser__c> listacc = [SELECT email__c,Password__c,AccountId__r.type FROM AccountUser__c WHERE Status__c=1 and email__c=:email and Password__c=:password LIMIT 1]; if(listacc.size()>0) { return 1; } else { return 0; } }
I call Rest API from android:
url = "https://test-dev-ed.my.salesforce.com/services/apexrest/AccountUsers/" client = OkHttpClient() jsonIn = FormBody.Builder() .add("email","tranbadai1@@gmail.com") .add("password","123456") .build() request = Request.Builder() .post(jsonIn) .header("Authorization", "Bearer "+accesstoken) .addHeader("Content-Type", "application/json") .url(url) .build() response = client.newCall(request).execute()Error:
[{"errorCode":"UNSUPPORTED_MEDIA_TYPE","message":"Content-Type header specified in HTTP request is not supported: application/x-www-form-urlencoded"}]