Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Batch programming check http call status

SET SOME_URL="https://my/api/to/get/something"
SET HTTP=
for /f %%a in ( 'curl -k -s -o NUL -w "%%{http_code}" "%SOME_URL%"' ) do set HTTP=%%a
if "%HTTP%" == "200" (
  echo "SUCCESS."
  REM Do rest of you stuff here
) else (
  echo "FAIL."
  REM Do any kind of cleanups
  exit /b
)
Comment

PREVIOUS NEXT
Code Example
Shell :: SHOULD AVOID - SECURITY RISK 
Shell :: using httrack on linux command line 
Shell :: powershell alternative && 
Shell :: anbox linux 
Shell :: install brew linux mint 
Shell :: grep simon 
Shell :: ubiquiti cli set compliance 
Shell :: how to migrate from yarn to npm 
Shell :: eslint --fix 
Shell :: kubectl get taints 
Shell :: powershell write UnauthorizedAccessException 
Shell :: linux reset date on file 
Shell :: run cmd in batch 
Shell :: Install Lumen CSV Reader package 
Shell :: sudo apt install powerman 
Shell :: git config --system core.longpaths true premission denied 
Shell :: What software can I Install after a fresh Ubuntu Setup 
Shell :: only migarte one table 
Shell :: keyboard backlight not working linux 
Shell :: URL (and Port) of Collabora Online-server 
Shell :: how to source scripts in same folder bash 
Shell :: Pinterest API github 
Shell :: ls show last item 
Shell :: Install ppsspp Linux 
Shell :: awk alternative linux 
Shell :: pip_install_packages.bat 
Shell :: alternative to the default mysql shell 
Shell :: install avogadro on ubuntu 
Shell :: turn on indexing win 11 
Shell :: install check_mk ubuntu 20.04 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =