Pista Posted May 6 Report Share Posted May 6 Hello, has anyone done data loading using POST request? Using GET, according to the instructions, it works fine. For example GET request from https//api.weatherapi.com/v1/current.json it works fine. But now I need a POST command. It works with a computer OK. But My PLC US10-B10-T24 returns error 3 "No packed received". Can anyone tell me, where I am making a mistake? Quote Link to comment Share on other sites More sharing options...
NoamM Posted May 14 Report Share Posted May 14 Hi Pista,Error 3 ("No packed received") means there is no communication between the PLC and your server. Try to ping it from PLC first. Quote Link to comment Share on other sites More sharing options...
Pista Posted May 30 Author Report Share Posted May 30 Hi NoamM, thank you for your response. I had the wrong DNS address. Ping works fine. I made my own webserver on my computer to see what the PLC sends me. (B4J software) It works on my web server but not on the company server. The company server returns an HTTP error. I suspect that the PLC sends the POST command in the same way as the GET command is sent. MetaData and URI as sent by the application are captured in the image. Method: POST, OriginalURI: /can_test2 And request is in table. But PLC sends: method: POST OriginalURI: /can_test2? Tester=fogonly&Barcode=ABCD table= NULL Do you have any idea how to feed POST function in PLC unitronics? Quote Link to comment Share on other sites More sharing options...
Elad S Posted May 31 Report Share Posted May 31 Hi, If you are using 1.33.236, there was a bug " REST: Requests with Hard-coded content parameters did not work" On the latest released version on the site 1.33.348 it is fixed. In your screenshot I don't see the content parameters part (the part where you fill the data you want to POST) What are you trying to POST? I think you tried to put the post data in query parameters instead of the content parameters. You wrote the PLC sends: " /can_test2? Tester=fogonly&Barcode=ABCD", which is a POST request without any data. Try to put the POST data in Content parameters. 1 Quote Link to comment Share on other sites More sharing options...
Pista Posted Wednesday at 07:51 PM Author Report Share Posted Wednesday at 07:51 PM Hi Elad S, I downloaded the latest software version 1.33.348 and it doesn't work. But I found that the PC application is sending Content-Type : application/x-www-form-urlencoded\r\n and PLC sends Content-Type : application/json\r\n. Unfortunately, the customer's server does not support the POST request with json Content type . Do you have an idea how to solve this? Well thank you. PLC send PC application send Quote Link to comment Share on other sites More sharing options...
Elad S Posted Thursday at 04:46 AM Report Share Posted Thursday at 04:46 AM UniStream currently doesn't support Content-Type : application/x-www-form-urlencoded. We opened a feature request on the manner. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.