|
- #!/bin/bash
- #
- # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
- #
- #
- # Run an HTTP POST against the API with an empty request entity
- #
- # Usage:
- #
- # bposte path [options]
- #
- # path : an API path
- # options : bscript options, see bubble.main.BubbleScriptOptions (and parent classes) for more info
- #
- # Environment variables
- #
- # BUBBLE_ENTITY : the filename that contains the JSON to send in the POST. If empty, entity is read from stdin
- # BUBBLE_API : which API to use. Default is local (http://127.0.0.1:PORT, where PORT is found in .bubble.env)
- # BUBBLE_USER : account to use. Default is root
- # BUBBLE_PASS : password for account. Default is root
- # BUBBLE_INCLUDE : path to look for JSON include files. default value is to assume we are being run from
- # bubble repo, bubble-models repo, or bubble-client and use include files from minimal model.
- #
- SCRIPT="${0}"
- SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
- . ${SCRIPT_DIR}/bubble_common
-
- URL="${1:?no URL provided}"
- shift
-
- cat /dev/null | BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble post -U ${URL} ${@}
|