Forums / Developer / http-post-request including Content-Type and Charset

http-post-request including Content-Type and Charset

Author Message

Daniel Scheiner

Wednesday 11 October 2006 7:11:01 am

Hi!

I know that in order to send a HTTP-Request I can make use of eZHTTPTool::sendHTTPRequest().
However I see no parameter that lets me set the Content-Type or the Charset I want to use!
Can I put those into the $postParameters?

Thanks!

Marius Eliassen

Friday 13 October 2006 6:27:58 am

Does not look like it according to the code from the ezhttptool.php class file

        $request = $method . ' ' . $path . ' ' . 'HTTP/1.1' . "\r\n" .
             "Host: $host\r\n" .
             "Accept: */*\r\n" .
             "Content-type: application/x-www-form-urlencoded\r\n" .
             "Content-length: " . strlen( $data ) . "\r\n" .
             "User-Agent: $userAgent\r\n" .
             "Pragma: no-cache\r\n" .
             "Connection: close\r\n\r\n";