Created
October 4, 2012 15:47
-
-
Save t2psyto/3834509 to your computer and use it in GitHub Desktop.
curl POST to gitlab snippets api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cat > content.py | |
| # -*- coding: utf-8 -*- | |
| # 日本語 | |
| # あめんぼあかいなあいうえお | |
| def hello(): | |
| print "hello world!" | |
| if __name__ == "__main__": | |
| hello() | |
| ^D | |
| $ curl.exe -F "title=test1" -F "file_name=content1.py" -F "code=<content.py" http://demo.gitlabhq.com/api/v2/projects/rubinius/snippets?private_token=qp6szjqmk8bTyMBrnJo5 | |
Author
Author
gg
Author
curl.exe -d '{"private_token":"qp6szjqmk8bTyMBrnJo5","title":"test1","file_name":"content1.py","code":"hogehoge\nhoge"}' http://demo.gitlabhq.com/api/v2/projects/rubinius/snippets
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
これもOKだった。
curl.exe -d '{"private_token":"qp6szjqmk8bTyMBrnJo5","title":"test1","file_name":"content1.py","code":"hogehoge\nhoge"}' http://demo.gitlabhq.com/api/v2/projects/rubinius/snippets
これはだめだった。違いがわからない。
echo '{"private_token":"qp6szjqmk8bTyMBrnJo5","title":"test1","file_name":"content1.py","code":"hogehoge\nhoge"}' > content.json
curl.exe -d '@content.json' http://demo.gitlabhq.com/api/v2/projects/rubinius/snippets