How do I perform put method?

You can use cURL (CURLOPT_PUT) or http stream context.