drupal_http_request() with POST returns a 405 error
In your post request you have specified 

'Content-Type' =&gt; 'application/x-www-form-urlencoded'


but your post data is in JSON format. 

Perhaps you need

'Content-Type' =&gt; 'application/json'


alternatively, pass the raw $data array as the post data for key=value&amp;key1=value2 form encoding. 

You also need to pass the function parameter $options instead of $data

$request = drupal_http_request($url, $options);