When sending HTTP post request to http://127.0.0.1:8080/restart to call the restart API, it responses 302 Found which redirects to http://127.0.0.1:8080/ .
HTTP/1.1 302 Found
Date: Fri, 15 Mar 2019 05:48:53 GMT
X-Content-Type-Options: nosniff
Location: http://127.0.0.1:8080/
Content-Length: 0
Server: Jetty(9.4.z-SNAPSHOT)
Then it will response a 503 Service Unavailable because Jenkins is restarting.
HTTP/1.1 503 Service Unavailable Date: Fri, 15 Mar 2019 05:48:54 GMT X-Content-Type-Options: nosniff Expires: 0 Cache-Control: no-cache,no-store,must-revalidate Content-Type: text/html;charset=utf-8 Server: Jetty(9.4.z-SNAPSHOT)