Hi,
Ewon Type: Flexy (FLEXY10100_00)
I am trying to post a log file to a remote server and retrieve the response but I receive a 32603 error. The file is successfully received by the server and a 200 OK response is sent but the Flexy still shows the 32603 error.
In the event logs I see the following errors:
21304: eftp-Invalid Source
28604: secu-The file the user is trying to write is unknown
32603: httpc-http request error
I am not making use of any VPN, eSync or data mailbox.
I get the same error when posting to the server using HTTPS and when posting to a test server on the local network using HTTP
Below is my code to post the data using the BASIC IDE:
FUNCTION GetCurrentTimeStamp$()
$EWON_TIME$ = TIME$
$GetCurrentTimeStamp$ = $EWON_TIME$(1 To 2) + $EWON_TIME$(4 To 5) + $EWON_TIME$(7 To 10) + “_” + $EWON_TIME$(12 To 13) + $EWON_TIME$(15 To 16) + $EWON_TIME$(18 To 19)
ENDFNlastTime$ = @GetCurrentTimeStamp$()
fileName$ = “historic_data_” + lastTime$ + “.csv”MakeRequest:
REQUESTHTTPX “https://[my_remote_server]/upload”,“POST”,“authorization=1234”,"",“file_upload=[$dtHT $fn”+fileName$+"]",“POSTERROR”
//REQUESTHTTPX “http://[my_local_server]:5000/upload”,“POST”,“authorization=1234”,"",“file_upload=[$dtHT $fn”+fileName$+"]",“POSTERROR”ONSTATUS "GOTO Response"
END
Response:
actionId% = GETSYS PRG, “ACTIONID”
eventId% = GETSYS PRG, “EVTINFO”
PRINT "Action ID: "; actionId%
PRINT "Event ID: "; eventId%
IF eventId% = actionId% THEN
currentState% = GETSYS PRG, “ACTIONSTAT”
PRINT "Current State: "; currentState%
IF currentState% = 0 THEN
body$ = RESPONSEHTTPX “RESPONSE-BODY”
PRINT body$
ELSE
PRINT "Error: "; currentState%
ENDIF
ENDIFEND
How can retrieve the correct response from the server?