change php http request method to curl