Mercurial > hg > orthanc-tests
comparison Database/Lua/HttpClient.lua @ 496:f78f7ee6b660
fix httpclient
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 17 Aug 2022 13:36:14 +0200 |
parents | 75d8a5261f82 |
children |
comparison
equal
deleted
inserted
replaced
495:75d8a5261f82 | 496:f78f7ee6b660 |
---|---|
64 retry = 10 | 64 retry = 10 |
65 response = nil | 65 response = nil |
66 while retry > 0 and response == nil do | 66 while retry > 0 and response == nil do |
67 print("HttpClient test: GET to httpbin.org") | 67 print("HttpClient test: GET to httpbin.org") |
68 response = ParseJson(HttpGet('http://httpbin.org/get', httpHeaders)) | 68 response = ParseJson(HttpGet('http://httpbin.org/get', httpHeaders)) |
69 sleep(1) | |
70 end | 69 end |
71 testSucceeded = testSucceeded and (response['headers']['Content-Type'] == 'application/json' and response['headers']['Toto'] == 'Tutu') | 70 testSucceeded = testSucceeded and (response['headers']['Content-Type'] == 'application/json' and response['headers']['Toto'] == 'Tutu') |
72 if not testSucceeded then print('Failed in HttpGet') PrintRecursive(response) end | 71 if not testSucceeded then print('Failed in HttpGet') PrintRecursive(response) end |
73 | 72 |
74 | 73 |