Curl: HTTP response code into a bash variable
Aug 2, 2023
export MY_ENDPOINT_HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://jsonplaceholder.typicode.com/todos/1")
export MY_ENDPOINT_HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://jsonplaceholder.typicode.com/todos/1")
Software Contractor — Java, Spring, k8s, AWS, Javascript @ London - hire me at https://elvisciotti.github.io/