Omnis Studio and Python

serban21 at gmail.com serban21 at gmail.com
Mon Dec 22 13:05:41 EST 2014


Hi

I'm working as a Python developer now, so I should be able to help...

The additional data should be passed in the request variable (in
data=request). That is supposed to be a dictionary, and it should be
populated before that call. Do you have that code?

See
http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests
.

Derek example is ok, but it's using another library than yours (httplib vs
requests). For this purpose, requests is much better.


Regards,
Serban Teodorescu


2014-12-22 19:53 GMT+02:00 Derek Delpero <derek.delpero at gmail.com>:

> Hi,
>
> Here's an example using a get request:
>
> import httplib
> conn = httplib.HTTPConnection("172.16.25.133:5921")
>
> conn.request("GET","/Ultra?OmnisLibrary=TestLibrary&OmnisClass=TestRemoteTask&test_parameter=1")
> res = conn.getresponse()
> data = res.read()
> conn.close()
>
> Hope that helps,
>
> Derek
>
>
> On Mon, Dec 22, 2014 at 10:54 AM, Grzegorz (Greg) Pasternak <
> grzegorz at niagara.com> wrote:
> >
> > Hello;
> > I am looking for some help re: Omnis Studio 4.x and up with Python.
> > Specifically I would like to run Python script against Omnis library
> using
> > HTTP ultra approach.
> > In archives I found reference to
> > Integrating Python With Omnis
> > http://omniscentral.com/integrating-python-with-omnis
> > but I can't seem to get more information.
> > I think this is the line in Python script that needs additional info
> about
> > Omnis library and Remote task class name:
> >
> > resp = requests.post(url=URL,data=request, auth=(USERNAME,PASSORD))
> >
> > Is anybody out there who has some experience with this and can help?
> > Please let me know,
> > Regards;
> > Greg
> >
> > _____________________________________________________________
> > Manage your list subscriptions at http://lists.omnis-dev.com
> >
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>



More information about the omnisdev-en mailing list