Send in header information
muzznak opened this issue · 1 comments
Allow users to send in header information when running the callrestapi method.
Just for documentation the tool supported passing the accept type and content type to the headers. This change allows the user to pass in additional information to the headers of the request from a file.
usage: callrestapi.py [-h] -e ENDPOINT -m {get,put,post,delete} [-i INPUTFILE]
[-a ACCEPTTYPE] [-c CONTENTTYPE]
[-o {csv,json,simple,simplejson}] [-t] [-hf HEADERFILE]
Call the Viya REST API
optional arguments:
-h, --help show this help message and exit
-e ENDPOINT, --endpoint ENDPOINT
Enter the REST endpoint e.g. /folders/folders
-m {get,put,post,delete}, --method {get,put,post,delete}
Enter the REST method.
-i INPUTFILE, --inputfile INPUTFILE
Enter the full path to an input json file
-a ACCEPTTYPE, --accepttype ACCEPTTYPE
Enter REST Content Type you want returned e.g
application/vnd.sas.identity.basic+json
-c CONTENTTYPE, --contenttype CONTENTTYPE
Enter REST Content Type for POST e.g
application/vnd.sas.identity.basic+json
-o {csv,json,simple,simplejson}, --output {csv,json,simple,simplejson}
Output Style
-t, --text Display Simple Text Results.
-hf HEADERFILE, --headerfile HEADERFILE
Enter the full path to a header json file