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

How can call httpPost of Rest API?
Apex Rest API:
response:
@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; } }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()
response:
[{"errorCode":"UNSUPPORTED_MEDIA_TYPE","message":"Content-Type header specified in HTTP request is not supported: application/x-www-form-urlencoded"}]How can call httpPost of Rest API?