HTTP help required

Just starting out? Need help? Post your questions and find answers here.
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

HTTP help required

Post 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.
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: HTTP help required

Post 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...
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: HTTP help required

Post by ozzie »

Thanks for the advice, Bisonte. I found the HTTP Library topic which provides exactly what I need.
Post Reply