Is there any http client on Switch 12?

Post Reply
alanoliveira
Newbie
Posts: 17
Joined: Mon Sep 15, 2014 10:48 pm

Is there any http client on Switch 12?

Post by alanoliveira »

Hi everyone!

Is there any way to make a http request in Switch 12 installed on a Windows 7 machine?



I have two scenarios I would like to use an http client to solve my problem.

In first one I would use a HTTP GET as a Producer.

In second I would like to make a POST with results.



The web application is out of my control, so I can't implement a SOAP webservice.



Thank you!
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Is there any http client on Switch 12?

Post by dkelly »

The only built-in HTTP functionality in Switch 12 is GET, Javascript function s.download(). You can use an external process such as cURL to implement other HTTP operations like PUT, POST, DELETE, etc.
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Is there any http client on Switch 12?

Post by gabrielp »

dkelly wrote: You can use an external process such as cURL to implement other HTTP operations like PUT, POST, DELETE, etc.
That's what I do and it works really well. :D
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore

Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
alanoliveira
Newbie
Posts: 17
Joined: Mon Sep 15, 2014 10:48 pm

Is there any http client on Switch 12?

Post by alanoliveira »

Thank you guys!



I didn't know s.download() function, It solves a half of my problem, so i'll have to install curl to use as an external process.



Thanks again ;)
pcobee
Member
Posts: 21
Joined: Fri Apr 01, 2011 5:06 pm
Location: Greenville NC
Contact:

Is there any http client on Switch 12?

Post by pcobee »

I use Microsofts XMLHTTP object in a Script for this all the time - mostly to retrieve graphics files from a remote service. You can implement GET, POST or SOAP with it. Works great.
Post Reply