Correct use of REQUESTHTTPX - Printable Version +- Ewon Technical Forum (https://techforum.ewon.biz) +-- Forum: Development (https://techforum.ewon.biz/forum-50.html) +--- Forum: BASIC Script (https://techforum.ewon.biz/forum-52.html) +--- Thread: Correct use of REQUESTHTTPX (/thread-1148.html) |
Correct use of REQUESTHTTPX - LennonEletronor - 22-01-2020 I'm trying to use the function REQUESTHTTPX, but I think I'm using the wrong format. I'm just trying to ping the server through the flexy. The path below is what I'm trying to reach: https://homolog.sonepar.com.br:7070/ms_vm/?req=ping&idEmpresa=60&maquina=103 The command that I'm using is: Code: REQUESTHTTPX "https://homolog.sonepar.com.br:7070/ms_vm/", "?req=ping&idEmpresa=60&maquina=103" What I'm doing wrong? RE: Correct use of REQUESTHTTPX - LennonEletronor - 24-01-2020 Code: request: I'm still trying to undertand what I'm doing wrong. When I try to use the script above I receive this: request actionid is 303 ***status: ??? ***all headers: ??? ***server header: ??? ***response body: ??? There are some errors in my code? Thanks RE: Correct use of REQUESTHTTPX - simon - 30-01-2020 Strange... On my side, it works good : 2020-01-30_12-33-18.png (Size: 54,26 KB / Downloads: 81) I use the firmware 14.0s02 The only thing I have added is the ONSTATUS "GOTO onEvent" at the beginning. Simon RE: Correct use of REQUESTHTTPX - djonedd - 18-03-2020 (30-01-2020, 01:34 PM)simon Wrote: Strange...Hi Simon, I have a little problem on "DATA POST" field The customer need a raw data, but when i use: $DATAPOST$ = "{\"email\" : \".....@....com\", \"password\":\"asd!@#\"}" the output always error when i use postman, the data should be like: [font=Tahoma, Verdana, Arial, sans-serif]"{"email" : ".....@....com", "password" : [/font][font=Tahoma, Verdana, Arial, sans-serif]"asd!@#"} Do you have some document for special character? thank you Joned[/font] RE: Correct use of REQUESTHTTPX - simon - 19-03-2020 Hi, The \ to escape characters does not work in BASIC. In your case, you have to use single quote ' to define your string value : '{"email" : ".....@....com", "password" : "asd!@#"}' Simon RE: Correct use of REQUESTHTTPX - sheeran - 31-03-2020 (30-01-2020, 01:34 PM)simon Wrote: Strange...Hi, Simon, I have tried what you have done, but the script keep throwing out Error code: 32603 Here is my code: Code: Init Part: I can get the response from browser or command line normally, the openAPI is from Swagger and this is just a test: Code: //API response Could you have a look and see what I have done wrong here please? Any help will be appreciated, thanks! RE: Correct use of REQUESTHTTPX - simon - 02-04-2020 Hi, To read the body, it is a$ = RESPONSEHTTPX "RESPONSE-BODY" I have tried myself and it works fine RE: Correct use of REQUESTHTTPX - simon - 01-09-2020 Hi, You can try this as S3: "Content-type= text/html; charset=utf-8" RE: Correct use of REQUESTHTTPX - hermeja - 04-09-2020 no data reaches the backend in a node js application. I need an example of type POST my request is REQUESTHTTPX "https://midominio.com/api/variables","POST","Content-Type: application/json; charset=utf-8","nombres=carlos&apellidos=sanchez&fecha=27/08/2020 18:01:00" doesn't work RE: Correct use of REQUESTHTTPX - simon - 10-09-2020 Hi, The header format must "Parameter = Value", not "Parameter : Value" So "Content-type=text/html" I know it is weird ;-) Simon |