2

How to tell httpie to retry for n times if the first connection failed?

Googlebot
  • 15,159
  • 44
  • 133
  • 229

1 Answers1

2

I don't think that httpie has this functionality built-in, but since it is just a command-line tool, you can use some sort of retry-method in whichever shell you use httpie... For example, in bash something like:

# Retry the 5 times command if returned exit code is not 0
for i in {1..5}; do http httpie.orgs && break || echo "Retrying..."; done
errata
  • 5,695
  • 10
  • 54
  • 99