Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion octorest/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ def send(self, data):
Sends data, currently not working properly.
OctoPrint server is unable to parse.
"""
self.socket.send(json.dumps(data))
self.socket.send(json.dumps([json.dumps(data)]))
2 changes: 1 addition & 1 deletion octorest/xhrstreaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ def send(self, data):
print("SENDING")
url = self.url.format(protocol="https" if self.secure else "http",
method="xhr_send")
response = self.socket.post(url, data=json.dumps(data))
response = self.socket.post(url, data=json.dumps([json.dumps(data)]))
return response
2 changes: 1 addition & 1 deletion octorest/xhrstreaminggenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ def send(self, data):
OctoPrint server returns 404
"""
url = '/'.join((self.url, 'xhr_send'))
response = self.session.post(url, data=json.dumps(data))
response = self.session.post(url, data=json.dumps([json.dumps(data)]))
return response