Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

HTTP Requests not being executed until function is finished

I'm running UE 4.8.3 and am trying to get an image from an URL.

All in all, the code works for

  • creating a request

  • binding a response function to the request

  • processing the returned content (the OnRequestCompleted function)

  • Converting the returned content to a 2DTexture image

The problem I'm encountering is that the HTTP request is not fired off until the calling function has already completed and returned control to the game controller. This doesn't do me any good because the function that initiates the HTTP request needs to work with/apply the image once the request has finished.

I tried making the HTTP request portion a second thread, but the thread crashes at the "Create Request" line:

 TSharedRef <IHttpRequest> Request = FHttpModule::Get().CreateRequest();

Is there a means to execute and process an HTTP request immediately?

This is pretty much the same issue as described in this question: HttpRequest delayed processing

Product Version: UE 4.8
more ▼

asked Apr 03 '16 at 03:45 PM in C++ Programming

avatar image

115 9 14 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

There was no way to make the HTTP request execute immediately.

So I just changed the design approach to accommodate allowing the result handler to call a blueprint at the end of processing the returned request. The blueprint made it very easy to take in the desired information and continue working with it from that point.

This was actually really nice because it allowed my main thread to continue tasks without being held up waiting for the response.

more ▼

answered Jun 23 '16 at 08:20 PM

avatar image

115 9 14 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question