1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-22 09:10:09 +01:00
phorge-phorge/externals/httpful/src/Httpful/Handlers/FormHandler.php

30 lines
550 B
PHP
Raw Normal View History

<?php
/**
* Mime Type: application/x-www-urlencoded
* @author Nathan Good <me@nategood.com>
*/
namespace Httpful\Handlers;
class FormHandler extends MimeHandlerAdapter
{
/**
* @param string $body
* @return mixed
*/
public function parse($body)
{
$parsed = array();
parse_str($body, $parsed);
return $parsed;
}
/**
* @param mixed $payload
* @return string
*/
public function serialize($payload)
{
return http_build_query($payload, null, '&');
}
}