Http_Client and ISO-8859-1

For programming and general questions on Zend Framework
Post Reply
kleinerpanzer
Posts: 1
Joined: Mon Apr 27, 2009 11:32 am

Http_Client and ISO-8859-1

Post by kleinerpanzer » Mon Apr 27, 2009 11:41 am

I can't fix it that the Zend_Http_Client is sending the request with character-set ISO-8859-1. I need it to reply an inbound from an SMS-Gateway.

Here is the code-snippet:

Code: Select all

private function _doHttpPostRequest($uri, $postparams) {
		$client = new Zend_Http_Client();
		$client->setUri($uri);
		$client->setHeaders('Accept-Charset', 'ISO-8859-1');
		$client->setEncType('text/xml; charset=ISO-8859-1');
		$client->setParameterPost($postparams);
		
		$response = $client->request('POST');
		
		$this->logger->info($client->getLastRequest());
		
		return $response;
	}
$postparams only contains text-data that are set in the code. The request must be sent in ISO-8859-1.
What i want is to set the header: Content-Type:text/xml; charset=ISO-8859-1 (this should be valid by the HTTP-protocol). But with setEncType() this is not possible. Any other way to do it (without changing the Zend_Http_Client)?

Post Reply