dsw88
dsw88

Reputation: 4592

Zend_HTTP_Client - How to set content type on PUT?

I'm using the Zend_HTTP_Client to make a REST call to a web service. The service is a data service that supports the usual CRUD suspects.

The service itself is working normally. I'm able to connect to the service using the Zend client, with one exception:

The "create" aspect of the web service requires that the resource id to be created be sent via a string in a PUT HTTP request. When I make that request using the Zend client, I get the following exception:

Error: exception 'Exception' with message 'Object was not created. Server returned status code: 500 for URL [the service url], body: Class: Zend_Http_Client_Exception Message: Cannot handle content type '' automatically. Please use Zend_Http_Client::setRawData to send this kind of content.

I'm hesitant to use the setRawData to this function, because I'm only sending it a string text value, so it's not like I'm sending it raw binary data or anything. What is the best way to resolve this so the client can make the PUT call to my service?

Upvotes: 0

Views: 1347

Answers (1)

Jrgns
Jrgns

Reputation: 25197

It's a known bug in Zend.

It's been fixed in version 1.11.10.

Upvotes: 1

Related Questions