POST to array of pos via WebServices
MikeTT
✭
Hello, I have been trying to update the values held in a RAPID array of type "pos" via POST request but so far I am not having any luck. I am able to do a GET on the array and receive a response but I guess I must not have the correct syntax for POST.
I am trying to post to the following url via Postman:
https://127.0.0.1:666/rw/rapid/symbol/RAPID/T_ROB1/AlignmentCalculator/SheetPointsArray/data
and then in the body I have for my KEY "value" and for the VALUE "[[20,20,0],[100,20,0],[100,100,0],[20,100,0]]"
but I get back HTTP response 415 Unsupported Media Type and retcode -1073414146
If anyone could please point me to where I'm going wrong I would be grateful!
I am trying to post to the following url via Postman:
https://127.0.0.1:666/rw/rapid/symbol/RAPID/T_ROB1/AlignmentCalculator/SheetPointsArray/data
and then in the body I have for my KEY "value" and for the VALUE "[[20,20,0],[100,20,0],[100,100,0],[20,100,0]]"
but I get back HTTP response 415 Unsupported Media Type and retcode -1073414146
If anyone could please point me to where I'm going wrong I would be grateful!
Tagged:
0
Best Answer
-
Hello,The 415 response is sent when the content-type header is wrong or missing. Information on headers can be found under Introduction-->Mime type in the web service manuals which can be found in this link:
—Nils OlofssonPC Software Support Engineer5
Answers
-
Hi Nils,
Thanks for the response. You were right my content type was set to "application/x-www-form-urlencoded" and I think I needed to set it to "application/x-www-form-urlencoded;v=2.0", I also noticed that I was sending my value as form data rather than x-www-form-urlencoded. So I am no longer getting a 415 response.
Unfortunately I am now getting 400 Bad Request and a different ret code. Here is the lookup response:<span class="name">SYS_CTRL_E_RAPID_SEMANTIC_ERROR</span><span class="code">-1073442802</span><span class="severity">Error</span><span class="description">Operation not allowed due to semantic error(s).</span>
Any ideas what the semantic error could be here?
Edit: It seems to be due to the fact that my array size in RAPID was set to 64 but I was only posting 4 points, when I reduced the array size to 4 the request worked fine, so I guess if I want to keep the max size as 64 I will need to pad out my post value with empty points.
Thanks for the help, you can close the thread if you like.0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings