Skip to content

The server does not see the parameters passed in the request body #204

Closed
@syfim

Description

@syfim

Hello. I create a project on symfony 3, and I send requests to gitlab using your api.
Parameters that are passed in the URL are processed correctly, but the parameters that I send in the body (post and put requests) are not processed by the server - it does not see them.
To send requests, I use the standard api methods.

For example, here is the api method:

public function createBranch($project_id, $branch_name, $ref)
    {
        return $this->post($this->getProjectPath($project_id, 'repository/branches'), array(
            'branch_name' => $branch_name,
            'ref' => $ref
        ));
    }

If I pass the correct values ​​$ project_id, $ branch_name, $ ref to it, it will look like this:
Request body example:

branch_name=6ca7357e3134c0092da7bc19d896dd03&ref=

Respoanse body:

{"error":"branch is missing"}

Since the get-requests work correctly, I can propose that the basic settings are correct.

Why can the server not recognize the information in the body?

More information about the request:

http://gitlab-stage.some.host.com/api/v4/projects/39/repository/branches?private_token=Some_token

 Request:
 
 Protocol Version | 1.1
 array:4 [▼
     "Content-Length" => array:1 [▼
         0 => "49"   
      ]   
     "Host" => array:1 [▼
          0 => "gitlab-stage.some.host.com"   
     ]   
     "Content-Type" => array:1 [▼
          0 => "application/x-www-form-urlencoded"  
      ]  
      "User-Agent" => array:1 [▼
          0 => "php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)"  
      ]
 ]

The package versions that I use:
PHP Version => 7.0.15
guzzlehttp/guzzle => 6.3.0
Symfony => 3.2.12 DEV
cURL Information => 7.29.0
json version => 1.4.0
GitLab 9.2.4
GitLab Shell 5.0.4
GitLab Workhorse v2.0.0
GitLab API v4
Git 2.11.1
Ruby 2.3.3p222
Rails 4.2.8
postgresql 9.6.1
m4tthumphrey/php-gitlab-api => dev-master

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions