# Httplib problem

**URL:** <https://forum.inductiveautomation.com/t/httplib-problem/2846>\
**Category:** Ignition\
**Created:** [April 6, 2011, 1:12pm UTC](https://forum.inductiveautomation.com/t/httplib-problem/2846 "2011-04-06T13:12:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ossy](https://avatars.discourse-cdn.com/v4/letter/o/90db22/32.png) [@ossy](https://forum.inductiveautomation.com/u/ossy)\
**Post date:** [April 6, 2011, 1:12pm UTC](https://forum.inductiveautomation.com/t/httplib-problem/2846/1 "2011-04-06T13:12:27Z")

</div>

Hello,

I am using version 7.2.4 (b48) of Ignition Gateway. I do need httplib from Jython std library in my script. I am not able to do my work by system.net-implementations. Httplib is listed as a supported std library. I am trying out first GET - example in following example:

[docs.python.org/release/2.1/lib/ ... mples.html](http://docs.python.org/release/2.1/lib/httplib-examples.html)

With following error:

AttributeError: module 'httplib' has no attribute 'HTTP'

When I try out to import httplib and print dir listing of this library, output is quite minimal when comparing regular Jython implementation:

Ignition:

import httplib  
print dir(httplib)

[' **doc**', ' **file**', ' **name**', 'socket']

Regular Jython in Debian 5.0:

Jython 2.2.1 on java1.6.0\_12  
Type "copyright", "credits" or "license" for more information.

> > > import httplib  
> > > print dir(httplib)  
> > > ['BadStatusLine', 'CannotSendHeader', 'CannotSendRequest', 'FakeSocket', 'HTTP', 'HTTPConnection', 'HTTPException', 'HTTPMessage', 'HTTPResponse', 'HTTPS', 'HTTPSConnection', 'HTTPS\_PORT', 'HTTP\_PORT', 'ImproperConnectionState', 'IncompleteRead', 'InvalidURL', 'LineAndFileWrapper', 'NotConnected', 'ResponseNotReady', 'SSLFile', 'SharedSocket', 'SharedSocketClient', 'StringIO', 'UnimplementedFileMode', 'UnknownProtocol', 'UnknownTransferEncoding', '\_CS\_IDLE', '\_CS\_REQ\_SENT', '\_CS\_REQ\_STARTED', '\_UNKNOWN', ' **all**', ' **doc**', ' **file**', ' **name**', 'errno', 'error', 'mimetools', 'socket', 'test', 'urlsplit']

I tried also import HTTP from httplib,

Ignition:

from httplib import HTTP

ImportError: cannot import name HTTP

Jython in Debian 5.0:

> > > from httplib import HTTP  
> > > print dir(HTTP)  
> > > [' **doc**', ' **init**', ' **module**', '\_connection\_class', '\_http\_vsn', '\_http\_vsn\_str', '\_setup', 'close', 'connect', 'debuglevel', 'getfile', 'getreply', 'putheader']

What can be behind of this difference?

I checked out Java local cache in my workstation (\Application Data\Sun\Java\Deployment\cache\FPMI\script\_lib). There are lot of python files, also file named httplib.py. There are implementations of full implementation of httplib, also class HTTP is implemented. This httplib.py tries to import file named mimetools.py. I noticed this mimetools.py file does not exist in this cache folder. I am not able to import mimetools also. Can it be root cause of original problem?

BR, Ossi Syri, Ouman Ltd

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 29, 2011, 7:00pm UTC](https://forum.inductiveautomation.com/t/httplib-problem/2846/2 "2011-04-29T19:00:16Z")

</div>

Yes, I think your troubleshooting is 100% right - that library is missing some dependent libraries. A quick look shows that those libraries (such as mimetools) themselvers require other ones, so it might be a bit of a mess for us to fix. I’ve made a bug ticket to look into the issue.

In the meantime take a look at the [system.net.httpGet()](http://www.inductiveautomation.com/support/usermanuals/ignition/index.html?system_net_httpget.htm) and [system.net.httpPost()](http://www.inductiveautomation.com/support/usermanuals/ignition/index.html?system_net_httppost.htm) functions. Do these cover what you wanted to do with the [tt]httplib[/tt] library?
