protected function http_build_query_for_curl($var, $prefix = null)
    {
        $return = [];

        foreach ($var as $key => $value) {
            $name = $prefix ? $prefix . '[' . $key . ']' : $key;

            if (is_array($value)) {
                $return = array_merge($return, $this->http_build_query_for_curl($value, $name));
            }
            else {
                // Convert file to something usable
                if ($key === 'file') {
                    $value = $this->addPostFile($value);
                }

                $return[$name] = $value;
            }
        }

        return $return;
    }