Body content is empty in http post from lua script

0

All the HTTP GET requests are working great as the tutorial shows.

But POST is not. I have look the c++ code looking for POST support and it seems to have. The body with the json is not been posted. Any ideas? My lua script:

	local session = {
Properties = {},
}
function session:OnActivate()
local url = "https://xyz.com/Prod/?id=37467f9e-74a0-4c68-b864-5055deb3d885"
local http_method = "POST"
local json_body = "{\"a\" : \"b\"}"
HttpClientComponentRequestBus.Event.MakeHttpRequest(self.entityId, url, http_method, json_body);
end
function session:OnHttpRequestSuccess(responseCode, responseBody)
Debug.Log("HTTP RESPONSE -- " .. responseCode);
Debug.Log("HTTP BODY -- " .. responseBody);
end
function session:OnHttpRequestFailure(errorCode)
Debug.Log("HTTP Error -- " .. errorCode);
end
function session:OnDeactivate()
self.notificationHandler:Disconnect();
end
return session
asked 7 years ago308 views
8 Answers
0

I was looking at the headers sent with the POST and the content-type is also not sent.

answered 7 years ago
0

tks a lot! version 1.8.0.0 here

did you update much thing on lua script support from 1.8 to 1.8+?

answered 7 years ago
0

I've created a request to have a tech take a look and chime in here. Sorry you are having these issues.

answered 7 years ago
0

In 1.0.8.1, nothing in the way of Lua support.

answered 7 years ago
0

@REDACTEDUSER

answered 7 years ago
0

Hello @REDACTEDUSER

Unfortunately, this is a known issue in 1.9 and is being addressed in the next release. Stay tuned!

Thanks!

answered 7 years ago
0

@REDACTEDUSER

answered 7 years ago
0

post paylod populated now! 1.10 fixed this. Tks a lot guys!

answered 7 years ago

This post is closed: Adding new answers, comments, and votes is disabled.