Api problem

$params = array(
            'command' => (string)$command,
        );
        if (!empty($comment)) {
            $params['comment'] = (string)$comment;
        }
        if (!empty($group)) {
            $params['group'] = (string)$group;
        }


1. If i send request

$url=$url_base . '/issue/' . urlencode($issue_id) . '/execute?' , http_build_query($params);

$this->http = curl_init($url);
...
curl_setopt($this->http, CURLOPT_POST, true);
curl_setopt($this->http, CURLOPT_COOKIE, implode(';', $this->cookies));

comment are added. Response code 200

2. If i send request

$url=$url_base . '/issue/' . urlencode($issue_id) . '/execute';

$this->http = curl_init($url);
...
curl_setopt($this->http, CURLOPT_POST, true);
curl_setopt($this->http,CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($this->http, CURLOPT_COOKIE, implode(';', $this->cookies));

comment are NOT added. Response code 200

in first example, if comment very big and line $url > 2048 charseter, i have a problem((

Why example 2 not working?
2 comments
Comment actions Permalink
rewrote the code and the problem disappeared. The question is not relevant
0

Please sign in to leave a comment.