put http request into try block