Relative Content

Tag Archive for restgotcp

Golang sending binary file over TCP via HTTP/REST

I’m writing a manager for cloud support of legacy IOT devices in Go, the devices establish a tcp connection with the manager, then that connection gets held open for bi-directional communication. The api for the devices is REST(ish) and the commands are written over the TCP pipe. For any HTTP/JSON commands that send a json payload, I have everything working, but yesterday I started working on firmware update, which requires I send a binary file instead of json.