Pista Posted May 6, 2023 Report Posted May 6, 2023 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?
NoamM Posted May 14, 2023 Report Posted May 14, 2023 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.
Pista Posted May 30, 2023 Author Report Posted May 30, 2023 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?
Elad S Posted May 31, 2023 Report Posted May 31, 2023 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
Pista Posted June 7, 2023 Author Report Posted June 7, 2023 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
Elad S Posted June 8, 2023 Report Posted June 8, 2023 UniStream currently doesn't support Content-Type : application/x-www-form-urlencoded. We opened a feature request on the manner.
Elad S Posted February 4 Report Posted February 4 The feature is available on the latest official UniStream version.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now