Custom Fields Values not gettimg set by Create Task API

Custom Fields Values not gettimg set by Create Task API

Hi,
I am trying to set custom fields on task from external platform.
Task is getting created successfully but the custom fields not getting set in Task.
I tried various ways to add custom fields values In Request JSON while sending request along with other paramete.
Task created successfully but custom fields not getting set.


Tryout 1:
var postData={
"name":taskName,
"flag":"internal",
"person_responsible":assignTo,
"priority":priority,
"custom_fields" :{
"UDF_CHAR3":recIntId
}
}
var headersArr= {
"authorization": "Bearer "+accessToken,
"content-type": "application/x-www-form-urlencoded",
"cache-control": "no-cache"
};

Tryout 2:
var postData={
"name":taskName,
"flag":"internal",
"person_responsible":assignTo,
"priority":priority,
"custom_fields" :{
"UDF_CHAR3":recIntId,
                                        "UDF_CHAR1": taskName
}
}
Tryout 3:
var postData={
"name":taskName,
"flag":"internal",
"person_responsible":assignTo,
"priority":priority,
"custom_fields" :[
                                                {
                                                      "UDF_CHAR3":recIntId
                                                },
                                                {   
                                                      "UDF_CHAR1": taskName
                }
                                          ]
}
Tryout 4:
var postData={
"name":taskName,
"flag":"internal",
"person_responsible":assignTo,
"priority":priority,
"custom_fields" :[{
"UDF_CHAR3":recIntId,
                                        "UDF_CHAR1": taskName
}]
}
How should I set task custom fields (2 fields). Its urgent .. please suggest a way.