Skip to content

Commit 1a33aaf

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

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/Http_API.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The usage is pretty 'pythonic' and support both polling and evented approaches:
99
from unreal_engine import IHttpRequest
1010
import json
1111

12-
request = IHttpRequest('Get', 'http://httpbin.org/user-agent')
12+
request = IHttpRequest('GET', 'http://httpbin.org/user-agent')
1313

1414
def response_received(request, response, success):
1515
data = json.loads(response.get_content_as_string())
@@ -21,3 +21,21 @@ request.bind_on_process_request_complete(response_received)
2121
# run the request
2222
request.process_request()
2323
```
24+
25+
If you prefer the polling apparoach, you need to check for the get_status() return value (an int). In the C++ it is defined as:
26+
27+
```c++
28+
namespace EHttpRequestStatus
29+
{
30+
enum Type
31+
{
32+
NotStarted,
33+
Processing,
34+
Failed,
35+
Failed_ConnectionError,
36+
Succeeded,
37+
}
38+
}
39+
```
40+
41+

0 commit comments

Comments
 (0)