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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
edf1945f
Commit
edf1945f
authored
Jul 12, 2018
by
Athar Hameed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add examples for array and hash type API params
parent
ba38931d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
doc/api/README.md
doc/api/README.md
+31
-1
No files found.
doc/api/README.md
View file @
edf1945f
...
...
@@ -388,7 +388,7 @@ For example, `/` is represented by `%2F`:
GET /api/v4/projects/diaspora%2Fdiaspora
```
## Branches
&
tags name encoding
## Branches
and
tags name encoding
If your branch or tag contains a
`/`
, make sure the branch/tag name is
URL-encoded.
...
...
@@ -399,6 +399,36 @@ For example, `/` is represented by `%2F`:
GET /api/v4/projects/1/branches/my%2Fbranch/commits
```
## Encoding API parameters of `array` and `hash` types
When making an API call with parameters of type
`array`
and/or
`hash`
, the parameters may be
specified as shown below.
### `array`
`import_sources`
is a parameter of type
`array`
:
```
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \
-d "import_sources[]=github" \
-d "import_sources[]=bitbucket" \
"https://gitlab.example.com/api/v4/some_endpoint
```
### `hash`
`override_params`
is a parameter of type
`hash`
:
```
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \
--form "namespace=email" \
--form "path=impapi" \
--form "file=@/path/to/somefile.txt"
--form "override_params[visibility]=private" \
--form "override_params[some_other_param]=some_value" \
https://gitlab.example.com/api/v4/projects/import
```
## `id` vs `iid`
When you work with the API, you may notice two similar fields in API entities:
...
...
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