Skip to content

Process HTTP return codes properly in generic send script

Created by: stavamichal

  • if the destination is the URL type, we need to process the return code from HTTP server properly and exit with it if it is different from 200 (OK)
  • save standard output to the temporary file, http error to variable and manage proper return code and text for such situation
  • in curl use '-s' to remove progress bars if file is transfered
  • in curl use '-w {http_code}' to redirect HTTP_CODE on standard output
  • in curl use '-o $TMPFILE' to redirect standard output of http server to temporary file
  • remove '-f' from curl to prevent masking http server errors

Merge request reports