Omnis Studio and Python
Grzegorz (Greg) Pasternak
grzegorz at niagara.com
Mon Dec 22 13:35:58 EST 2014
Thanks a lot for quick responses.
Here is what is working now for me:
=======================
import requests
URL = 'http://127.0.0.1:5912/ultra?OmnisLibrary=MyHttp&OmnisClass=rtHttpDoTest&data=%s'
def get_request():
with open('request.txt') as f:
request = f.read()
return request
def send_request():
global URL
request = get_request()
URL=URL % request
resp = requests.get(url=URL)
print resp.text
if __name__ == '__main__':
send_request()
=======================
Basically the data is passed in URL part and instead of:
resp = requests.post(url=URL,data=request, auth=(USERNAME,PASSORD))
the script is using
resp = requests.get(url=URL)
Perhaps the above could be done in a bit different way, but it is working now for me.
Thanks again to all who replied,
Greg
On Dec 22, 2014, at 11: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
More information about the omnisdev-en
mailing list