Skip to content

Instantly share code, notes, and snippets.

View alpoza's full-sized avatar

Albert alpoza

View GitHub Profile
@alpoza
alpoza / curl.md
Created March 23, 2018 09:20 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@alpoza
alpoza / curl.sh
Created November 20, 2018 11:24 — forked from bartfastiel/curl.sh
curl -s -u admin:admin -XPOST "localhost:9000/api/organizations/enable_support" | python -m json.tool
curl -s -u admin:admin -XPOST "localhost:9000/api/organizations/create?name=myorg&key=myorg" | python -m json.tool
curl -s -u admin:admin -XPOST "localhost:9000/api/qualityprofiles/create?name=myprofile&language=java&organization=myorg" | python -m json.tool
curl -s -u admin:admin -XPOST "localhost:9000/api/qualityprofiles/search" | python -m json.tool
curl -s -u admin:admin -XPOST "localhost:9000/api/qualityprofiles/search?organization=myorg" | python -m json.tool
curl -s -u admin:admin -XPOST "localhost:9000/api/qualityprofiles/search?defaults=true" | python -m json.tool
curl -s -u admin:admin -XPOST "localhost:9000/api/projects/create?project=myproject&name=myproject" | python -m json.tool
curl -s -u admin:admin -XPOST "localhost:9000/api/qualityprofiles/search?project=myproject" | python -m json.tool
#delete
@alpoza
alpoza / ucd_upload_plugins_from_dir.py
Created March 20, 2019 10:01 — forked from sgwilbur/ucd_upload_plugins_from_dir.py
Example of howto use the UCD rest api to update plugins from a directory of plugins, requires the requests library.
#!/usr/bin/env python
import os, requests, json, re
## requirements.txt:
#
# httplib2==0.8
# requests==2.0.1
# wsgiref==0.1.2
# hard coded