Shortened code for setting header for url request