# MiR 250 Robot with Rest API need help with help with HTTP Post

**URL:** <https://forum.inductiveautomation.com/t/mir-250-robot-with-rest-api-need-help-with-help-with-http-post/67853>\
**Category:** Ignition\
**Created:** [December 20, 2022, 8:20pm UTC](https://forum.inductiveautomation.com/t/mir-250-robot-with-rest-api-need-help-with-help-with-http-post/67853 "2022-12-20T20:20:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![soundwavesct](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@soundwavesct](https://forum.inductiveautomation.com/u/soundwavesct)\
**Post date:** [December 20, 2022, 8:20pm UTC](https://forum.inductiveautomation.com/t/mir-250-robot-with-rest-api-need-help-with-help-with-http-post/67853/1 "2022-12-20T20:20:39Z")

</div>

OK, so I am trying to interface with a MiR 250 Robot.  
At this point I need to simply supply a list of "Missions" stored in the system.  
And then have the user select a Mission and put it in the robots queue.

I have no problem with the get request, but get a 400 response when using a Post to send it a new Mission.

This is proof of concept, so the Mission value is hardcoded but it is correct.

```auto
import json
ip='1.1.1.1'
host='http://' + ip + '/api/v2.0.0/'

#Format Headers
headers = {}
headers['Content-Type']='application/json'
headers['Authorization']=' Basic Bla Bla Bla'
headers['Accept-Language']='en-US'

get_missions = system.net.httpGet(host + 'missions', headerValues = headers)
#print(get_missions)
mission_id = {"mission_id": "ea8895da-79e5-11ec-8aff-000129a09448"}
post_mission = system.net.httpPost(host + 'mission_queue', json = mission_id, headerValues=headers)
#print(headers)

```

Here is a working example from their documentation for context.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/96dff8ede1ce3296b15f41aeff7d11d14aec8428.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/b/3b3f32d5f1a39db210bcbe9e8a77c445c7fc6275.png)

Any Input would be appreciated.  
Thanks,  
Brandon

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [December 20, 2022, 8:26pm UTC](https://forum.inductiveautomation.com/t/mir-250-robot-with-rest-api-need-help-with-help-with-http-post/67853/2 "2022-12-20T20:26:00Z")

</div>

`system.net.httpPost` doesn't have a `json` keyword arg.

What version of Ignition are you using? If you're on 8+ I'd start by switching to `system.net.httpClient`.

---

<div class="post-metadata">

**Author:** ![soundwavesct](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@soundwavesct](https://forum.inductiveautomation.com/u/soundwavesct)\
**Post date:** [December 20, 2022, 9:04pm UTC](https://forum.inductiveautomation.com/t/mir-250-robot-with-rest-api-need-help-with-help-with-http-post/67853/3 "2022-12-20T21:04:57Z")

</div>

Yes, I am 8+.  
I started with some older sample code, so that would explain the json.

I tried updating put am still having the same result.

This is what I tried.

```auto
client = system.net.httpClient()
response = client.post(host + 'mission_queue', params=mission_id, headers=headers)

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [December 20, 2022, 9:06pm UTC](https://forum.inductiveautomation.com/t/mir-250-robot-with-rest-api-need-help-with-help-with-http-post/67853/4 "2022-12-20T21:06:52Z")

</div>

You probably want `data=mission_id`, not `params`, based on your documentation.

---

<div class="post-metadata">

**Author:** ![soundwavesct](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@soundwavesct](https://forum.inductiveautomation.com/u/soundwavesct)\
**Post date:** [December 21, 2022, 10:55am UTC](https://forum.inductiveautomation.com/t/mir-250-robot-with-rest-api-need-help-with-help-with-http-post/67853/5 "2022-12-21T10:55:52Z")

</div>

That did the trick, Thanks!!
