Whatever data I want to send whether be a text file or a PDF am able to give but how do I give my desired name to the file ?? And what about other types of files ?? What should be the request header please give an example had a look at the API documentation but not getting it ...
It seems you're using a basic upload.
You can use the suggested answer in this SO post:
Use multipart upload and specify the tile in the metadata part
{
"title": "My File"
}
Types of files are called MiME types. You can see the supported MiME types here.
Check this Multipart Upload guide for more info.