Why do I get…
‘=’ expected (3) 6: REQUESTHTTPX “https:
//test.iotecllc.com/test/m2web/CallOut.p
hp?message=‘Call out sent this’”, “Post”
when executing this in a script?
Why do I get…
‘=’ expected (3) 6: REQUESTHTTPX “https:
//test.iotecllc.com/test/m2web/CallOut.p
hp?message=‘Call out sent this’”, “Post”
when executing this in a script?
Hello @George,
It seems like you most likely do not have the syntax correct for a post request. See section 3.38 for details. You might need to add the post data outside the URL.
Deryck
Thanks Derek,
Is section 3.38 is the eWon programming manual?
Hello Deryck,
I took an example straight from the programming manual and executed it from the script control command line. I expected to see a new error.
It gave the exact same response.
‘=’ expected (3) : REQUESTHTTPX"http://w
ww.example.com/hello.php","GET"
Any ideas?
Running fw 11.2s2
You might be running into an error due to another line of code. Try running the line directly in the console. The GET request from the user manual should work, you post request is flagging a syntax error.
I did that and the same error
Try the following request. Make sure the quote characters are correct when you copy it out. I have seen issues where the character is changed.
REQUESTHTTPX "https://test.iotecllc.com/test/m2web/CallOut.php","POST","Content-Type=text/plain","message=Call out sent this"
Hello @George what firmware and ewon device are you using? It looks like you might be using a CD without support for requesthttpx.
If you are using an Flexy you can update the firmware and be able to use the new basic IDE. Otherwise you will need to refer to our older programming reference guide linked below. With the older IDE you have the puthttp function that you can use to post files. See page 47 for details on on using it with a post request.
RG-002-0-EN-(Programming Reference Guide)(old).pdf (837.0 KB)
Deryck
Deryck,
Things seem to be pointing to hardware or firmware version. This works as expected on a Flexy205 fw13.2s1 but fails on eWonCD 4005 fw 11.2s2
REQUESTHTTPX “https://test.iotecllc.com/test/m2web/CallOut.php",“POST”,"","message='eWon Call out sent this’”. Any chance I will be able to get this to work on my 4005CD?
Hi George,
You are correct the function is not supported on the CD’s you will need to use the PUTHTTP request available on the older basic IDE.
Deryck
Thanks Deryck!
I had tried the puthttp but am getting 406 not allowed from the server. Any suggestions?
Hi @George,
If you are seeing a 4xx error that would be a response from the Server. This tells us the ewon sent the response but the server is saying the message is not allowed. You might need to check what type of connections the server supports and make sure you are posting valid data.
Deryck
Thank Deryck for the update.
I will follow up if something interesting comes of the server evaluation.
I am curious though when I research the firmware notes it indicates that 11.2S2 should support HTTPX. Are these notes specific to product sereis? I have included a snap shot were I got the info incase I am looking in the wrong place. The
fw notes indicates HTTPX was added around 11 Is that not correct?
An excerpt from the firmware release notes
[Deprecated] version 11.1s0
Hi George,
Do you have a second tab with the new Basic IDE? I don’t have one available to verify this myself, but you might need to run the code there to access the BASIC2 commands.
Deryck
Hi George,
I just double checked this with the ewon Team and they corrected me that the CD firmware does not have support for the BASIC 2 IDE. It was added in FW11.x for the Flexy only.
Regards,
Deryck
Thanks Deryck,
So no recourse on the HTTPX and must go down the PUTHTTP route?
Correct, you will need to use the PUTHTTP option with the CD.
Deryck