Skip to content

Commit f8a7b32

Browse files
author
Roberto De Ioris
authored
Update Http_API.md
1 parent 1a33aaf commit f8a7b32

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎docs/Http_API.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,22 @@ namespace EHttpRequestStatus
3838
}
3939
```
4040

41+
so any value >= 2 will be a sign of request completion:
42+
43+
```python
44+
from unreal_engine import IHttpRequest
45+
import json
46+
47+
request = IHttpRequest('GET', 'http://httpbin.org/user-agent')
48+
49+
# run the request
50+
request.process_request()
51+
52+
# check its status
53+
54+
if request.get_status() >= 2:
55+
response = request.get_response()
56+
data = json.loads(response.get_content_as_string())
57+
ue.log(data['user-agent'])
58+
```
4159

0 commit comments

Comments
 (0)