Jump to content

Recommended Posts

Posted

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?

 

Post test.PNG

RestPost1.JPG

RestPost2.JPG

RestPost3.JPG

RestPost4.JPG

  • 3 weeks later...
Posted

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

posttest1.PNG.0d570fcb9a1e4651825d7fe127e39c99.PNG

posttest2.thumb.PNG.8eed40661f261bec4667cd6c6952c132.PNG

posttest3.thumb.PNG.2cfb4059b00e3db688437a6027b2c357.PNG

Do you have any idea how to feed POST function in PLC unitronics?

Posted

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.
 

  • Upvote 1
Posted

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.

SharktestB0.thumb.PNG.1fea8abd71efed9e1f4dd409052c5e8c.PNG

PLC send

SharktestB1.thumb.PNG.ce5d88370cd631a188e06fa371227792.PNG

PC application send

SharktestA1.thumb.PNG.7a8367fa52e3cf237223170730d22b42.PNG

  • 7 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.