Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5e21b9ca
Commit
5e21b9ca
authored
4 years ago
by
Davin Walker
Committed by
Marcel Amirault
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional details on Payload Types
parent
9baace02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
doc/api/README.md
doc/api/README.md
+22
-0
No files found.
doc/api/README.md
View file @
5e21b9ca
...
...
@@ -491,6 +491,28 @@ GET /api/v4/projects/1/branches/my%2Fbranch/commits
GET /api/v4/projects/1/repository/tags/my%2Ftag
```
## Request Payload
API Requests can use parameters sent as
[
query strings
](
https://en.wikipedia.org/wiki/Query_string
)
or as a
[
payload body
](
https://tools.ietf.org/html/draft-ietf-httpbis-p3-payload-14#section-3.2
)
.
GET requests usually send a query string, while PUT/POST requests usually send the payload body:
-
Query string:
```
shell
curl
--request
POST
"https://gitlab/api/v4/projects?name=<example-name>&description=<example-description>"
```
-
Request payload (JSON):
```
shell
curl
--request
POST
--header
"Content-Type: application/json"
--data
'{"name":"<example-name>", "description":"<example-description"}'
"https://gitlab/api/v4/projects"
```
URL encoded query strings have a length limitation. Requests that are too large will
result in a
`414 Request-URI Too Large`
error message. This can be resolved by using
a payload body instead.
## Encoding API parameters of `array` and `hash` types
We can call the API with
`array`
and
`hash`
types parameters as shown below:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment