# system.net.httpPost Help

**URL:** <https://forum.inductiveautomation.com/t/system-net-httppost-help/11939>\
**Category:** Ignition\
**Created:** [July 18, 2016, 1:51am UTC](https://forum.inductiveautomation.com/t/system-net-httppost-help/11939 "2016-07-18T01:51:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmorata](https://avatars.discourse-cdn.com/v4/letter/w/e9a140/32.png) [@wmorata](https://forum.inductiveautomation.com/u/wmorata)\
**Post date:** [July 18, 2016, 1:51am UTC](https://forum.inductiveautomation.com/t/system-net-httppost-help/11939/1 "2016-07-18T01:51:13Z")

</div>

Hi! I’m new in using Ignition and needs a little help on system.net.httpPost

I’m trying to reuse an existing and working .NET WCF Restful Web Service.  
However, when trying to consume the WS using the below python code:

[b]url = ‘[http://localhost/testserv/EquipmentService.svc/Create2](http://localhost/testserv/EquipmentService.svc/Create2)’  
param = {“id”:“test11234”}

response = system.net.httpPost(url, param)  
system.gui.messageBox(response)[/b]

the parameter string id that i passed unto the webservice becomes null so I will fail inserting the data  
to the DB.

this is my C# code for the webservice:

This is the interface:

[OperationContract]  
[WebInvoke(Method = “POST”, UriTemplate = “Create2?id={id}”, ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Xml)]  
string Create2(string id);

this is the actual service code:

[b]public bool Create2(string id)  
{  
string connString = ConfigurationManager.ConnectionStrings[“MyConn”].ConnectionString;

```
        try
        {
            using (SqlConnection conn = new SqlConnection(connString))
            {
                using (SqlCommand cmd = new SqlCommand("InsertEquipment", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add("@EquipID", SqlDbType.NVarChar).Value = id;

                    conn.Open();
                    cmd.ExecuteNonQuery();
                }
            }
            return true;
        }
        catch(Exception e)
        {
            return false;
        }
    }[/b]

```

When I tried to determine the value of the parameter string id, it seems that the value being passed is null so the response i will be getting from the Restful API will always be false.

Btw. Some python forum recommends using “requests.post()” however, I cant seem to import the requests module in Ignition.

Any help is greatly appreciated. 😃

---

<div class="post-metadata">

**Author:** ![wmorata](https://avatars.discourse-cdn.com/v4/letter/w/e9a140/32.png) [@wmorata](https://forum.inductiveautomation.com/u/wmorata)\
**Post date:** [July 19, 2016, 1:49am UTC](https://forum.inductiveautomation.com/t/system-net-httppost-help/11939/2 "2016-07-19T01:49:52Z")

</div>

Nevermind. Found some solutions online. Thanks.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 20, 2016, 10:50pm UTC](https://forum.inductiveautomation.com/t/system-net-httppost-help/11939/3 "2016-07-20T22:50:05Z")

</div>

Hi! Welcome to the forums. Sorry to be late for the party. 🙂

Glad you got it sorted out. Just wanted to point out that Ignition uses Jython and not CPython (that’s pyhton based on C). You’ll find that some libraries-- numpy, for example-- won’t work with Jython because it’s heavily C-based. Pure Pyhton code usually works well, but anything requiring a C library will derail.

Just wanted to give you a heads up for future reference!

EDIT: Almost forgot: Jython will let you use Java libraries, so there will be other features available to you.

Regards,
