Skip to content

Error sending array through POST #19

Description

@StApostol

Hello
There was a problem with the method of POST, when I send an array of error takes off.
Helps formatting data to be sent via function http_build_query


public function post($url, $data, $params = array(), $debug = false)
{
        $url = $this->buildUrl($url, $params);
        $options = $this->getOptions();
        $options[CURLOPT_POST] = true;
        $options[CURLOPT_POSTFIELDS] = is_array($data) ? http_build_query($data) : $data;
        return $this->exec($url, $options, $debug);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions