# HTML5 HTTPRequest: OnProcessRequestComplete not called

**URL:** <https://forums.unrealengine.com/t/html5-httprequest-onprocessrequestcomplete-not-called/314171>\
**Category:** Platform & Builds\
**Tags:** HTML5, httprequest, unreal-engine, question\
**Created:** [April 7, 2015, 3:15pm UTC](https://forums.unrealengine.com/t/html5-httprequest-onprocessrequestcomplete-not-called/314171 "2015-04-07T15:15:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomdelerue\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomdelerue\_1](https://forums.unrealengine.com/u/tomdelerue_1)\
**Post date:** [April 7, 2015, 3:15pm UTC](https://forums.unrealengine.com/t/html5-httprequest-onprocessrequestcomplete-not-called/314171/1 "2015-04-07T15:15:32Z")

</div>

I have run into some trouble with the HttpRequest-\>OnProcessRequestComplete function when I test my project in HTML5.

The PostRequest function works just fine (because the data is logged in the database table) but the RequestComplete function doesn’t seem to fire.

Everything works fine in the dekstop builds. (UE 4.7.4 - binary, emscripten 1.29.0)

Could this be a bug or am I missing something?

PostRequest Functionality

```
void UConnection::PostRequest(UObject* WorldContextObject)
{
	TSharedRef<IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();

	HttpRequest->SetVerb(TEXT("POST"));
	HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
	HttpRequest->SetURL("url");
	HttpRequest->SetContentAsString(TEXT("text"));

	HttpRequest->OnProcessRequestComplete().BindUObject(this, &UConnection::RequestComplete);

	HttpRequest->ProcessRequest();
}

```

RequestComplete Functionality

```
void UConnection::RequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{
	if (!bWasSuccessful)
	{
		UE_LOG(ConnectionLog, Error, TEXT("Request unsuccessful, check the url"));
		return;
	}

	Content = Response->GetContentAsString();

	UE_LOG(ConnectionLog, Log, TEXT("Content: %s"), *Content);
}

```

---

<div class="post-metadata">

**Author:** ![tomdelerue\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomdelerue\_1](https://forums.unrealengine.com/u/tomdelerue_1)\
**Post date:** [April 8, 2015, 12:57pm UTC](https://forums.unrealengine.com/t/html5-httprequest-onprocessrequestcomplete-not-called/314171/2 "2015-04-08T12:57:46Z")

</div>

After looking a little more into this on the browser side it seemed to be a CORS issue.

Making a long story short I noticed I was visiting the project website trough it’s ‘naked’ domain (without the www in front). Though why not, this could maybe be the issue. Tried again, adding the ‘www’ in front of the address, and the response came trough.

So simply adding the ‘www’ in front of the url of the project website seemed to be the solution in this case.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_83949151](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_83949151](https://forums.unrealengine.com/u/anonymous_user_83949151)\
**Post date:** [May 26, 2015, 9:07am UTC](https://forums.unrealengine.com/t/html5-httprequest-onprocessrequestcomplete-not-called/314171/3 "2015-05-26T09:07:44Z")

</div>

Hi . I have got a similar error, you can see my error in [HTTP request don't run on HTML5 package - Platform & Builds - Epic Developer Community Forums](https://answers.unrealengine.com/questions/228288/http-request-dont-run-on-html5-package.html)  
I tryed to write the url with ‘www’ without result. ☹  
Can I see your code, and the \*.build.cs file?, or can you give me some ideas about this?  
Thanks!!
