function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Swati BhaipSwati Bhaip 

CustomField


JSONObject leadField = new JSONObject();

leadField.put("Field Label", "Home");
  leadField.put("Field Name","Home");


PostMethod post = new PostMethod(instanceUrl
   + "/services/data/v20.0/sobjects/Lead/LeadCustomField");

I can write this sample code for creating Lead Custom Field using Rest Api but the passing url to PostMethod is not working Please Help me for creating a Lead custom Field using Rest Api.
Sonam_SFDCSonam_SFDC
You should be using the METADATA API if you wish to crate a custom field rather than the REST API.

REST API is used to fetch and create data(records) in salesforce but METADATA API is the one which deals with creation of objects/fields etc
https://www.salesforce.com/us/developer/docs/api_meta/

Hoping I've understood your requirement correctly.. 
Hargobind_SinghHargobind_Singh
Swati, refer to this page, this has an example to create a custom field using Metadata API : 

http://salesforce.stackexchange.com/questions/18843/using-meta-data-api-in-apex