| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 33313c4 commit 3300a06
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,11 +10,14 @@ from unreal_engine import IHttpRequest | |||
| 10 | 10 | import json | |
| 11 | 11 | ||
| 12 | 12 | request = IHttpRequest('Get', 'http://httpbin.org/user-agent') | |
| 13 | - request.process_request() | ||
| 14 | 13 | ||
| 15 | - response = request.get_response() | ||
| 14 | + def response_received(request, response, success): | ||
| 15 | + data = json.loads(response.get_content_as_string()) | ||
| 16 | + ue.log(data) | ||
| 16 | 17 | ||
| 17 | - data = json.loads(response.get_content_as_string()) | ||
| 18 | + # bind OnProcessRequestComplete event to the response_received callable | ||
| 19 | + request.bind_on_process_request_complete(response_received) | ||
| 18 | 20 | ||
| 19 | - ue.log(data) | ||
| 21 | + # run the request | ||
| 22 | + request.process_request() | ||
| 20 | 23 | ``` | |
| Back | FazBrowse Home | New Git URL |
0 commit comments