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 


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.
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

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