This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
daphee's profile picture

[1.63]

Started by daphee, 05 June 2014 - 11:04 AM
daphee #1
Posted 05 June 2014 - 01:04 PM
VERSION
CC 1.63

DESCRIPTION
Doing a call to http.post with body AND headers hangs the computer and prints this exception: http://pastebin.com/eaNrq0t1

EXPECTED RESULT
Call being handled by CC and returning to the computer

REPRODUCTION STEPS
This program. http://pastebin.com/bNDgAT1Q
Or any call to http.post with an non-empty body and an non-empty header

I think the problem is in HTTPRequest.java in the run method.
The if-clause to write the headers gets executed AFTER the if-clause to write the body. This would explain the exception: Already connected. A solution should be to just move the if on line 99 before the if on line 81.

EDIT: Sorry forgot to set the title: http.post with body and headers not working
Edited on 05 June 2014 - 11:05 AM
SquidDev #2
Posted 05 June 2014 - 02:15 PM
I think I can also confirm this. The error message appears in ForgeModLoader-client-0.log.