Page 1 of 1

HTTP help required

Posted: Sun Mar 09, 2014 9:58 am
by ozzie
I'm trying to include in my program an interface to vMix, and the vMix developers have given me a link to the vMix API help. This states: "The vMix API provides access to common functions through the HTTP protocol" and gives some examples.

However, I can't get vMix to respond to anything I send it, and before I get on to the vMix developers I'd like to make sure that I'm heading down the right path in PB (using PB 5.20 LTS).

I open the network connection using

Code: Select all

OpenNetworkConnection(127.0.0.1, 8088)
which returns the connection identifier (57760664 in my last test).

I then send a command string like this:

Code: Select all

SendNetworkString(57760664, "/API/?Function=AddInput&Value=Video|C:\Users\Mike\Videos\Alaska.wmv" + #CRLF$, #PB_Ascii)
which returns 69 as the number of bytes sent.

But nothing happens in vMix. Are my PB commands correct for this type of interface? If so then I'll contact the vMix developers to see what I'm doing wrong. btw, I tried both upper and lower case for the "/API/" part of the command as both are mentioned in the vMix Help, but I guess this is not case-sensitive in Windows.

Re: HTTP help required

Posted: Sun Mar 09, 2014 10:53 am
by Bisonte
I think you have to send a full HTTP-Request (<- Search Keyword on this forum),
not only a single string with your parameters...

Re: HTTP help required

Posted: Sun Mar 09, 2014 11:47 pm
by ozzie
Thanks for the advice, Bisonte. I found the HTTP Library topic which provides exactly what I need.