Formatting HTTP Send_String
gcolosino
Posts: 3
Hi All.
I have no experience strings for HTTP devices and am looking for a little help putting together the send_string for a Matrox HDX. All I need to do is start and stop the encoder but it doesn't respond to my first attempts.
According to the API the command is:
http://<username>:<password>@<ipAddress>/Monarch/syncconnect/sdk.aspx?command=<command>.
With my variables it is:
http://admin:admin@192.168.3.200/Monarch?synconnect?sdk.aspx?command=StarttBothEnco ders.
What I am sendind is:
SEND_STRING dvMatrox,"'GET /Monarch/syncconnect/sdk.aspx?command=StartBothEncoders HTTP/1.1',$0D,$0A,'Host: 192.168.0.200:80',$0D,$0A,'Authorization: Basic YWRtaW4:YWRtaW4',$0D,$0A,'Connection: keep-alive',$0D,$0A,$0D,$0A"
Any help would be appreciated.
I have no experience strings for HTTP devices and am looking for a little help putting together the send_string for a Matrox HDX. All I need to do is start and stop the encoder but it doesn't respond to my first attempts.
According to the API the command is:
http://<username>:<password>@<ipAddress>/Monarch/syncconnect/sdk.aspx?command=<command>.
With my variables it is:
http://admin:admin@192.168.3.200/Monarch?synconnect?sdk.aspx?command=StarttBothEnco ders.
What I am sendind is:
SEND_STRING dvMatrox,"'GET /Monarch/syncconnect/sdk.aspx?command=StartBothEncoders HTTP/1.1',$0D,$0A,'Host: 192.168.0.200:80',$0D,$0A,'Authorization: Basic YWRtaW4:YWRtaW4',$0D,$0A,'Connection: keep-alive',$0D,$0A,$0D,$0A"
Any help would be appreciated.
0
Comments
{
SWITCH (x)
{
Case 1: //Start
{
IP_CLIENT_OPEN(dvMatrox.PORT,'192.168.0.200',nIPPort,1)
SEND_STRING dvMatrox,"'GET /Monarch/syncconnect/sdk.aspx?command=StartBothEncoders HTTP/1.1',$0D,$0A,'Host: 192.168.0.200:80',$0D,$0A,'Authorization: Basic YWRtaW4:YWRtaW4',$0D,$0A,'Connection: keep-alive',$0D,$0A,$0D,$0A"
IP_CLIENT_CLOSE(dvMatrox.PORT)
}
Case 2: //Stop
{
IP_CLIENT_OPEN(dvMatrox.PORT,'192.168.0.200',nIPPort,1)
SEND_STRING dvMatrox,"'GET /Monarch/syncconnect/sdk.aspx?command=StopBothEncoders HTTP/1.1',$0D,$0A,'Host: 192.168.0.200:80',$0D,$0A,'Authorization: Basic YWRtaW4:YWRtaW4',$0D,$0A,'Connection: keep-alive',$0D,$0A,$0D,$0A"
IP_CLIENT_CLOSE(dvMatrox.PORT)
}
}
nIPPort is 80
Hello,
I am controling a Matrox Monarch and i have the same problem, can you help me? You find a solution?
You might want to use the 'Postman' Application. you can just fill in the details and it will show you the header etc...
I use it when I can't get stuff to work. Its quick for changing the info and checking what works and seeing the replies...really helps in development. www.postman.com
Id try sending the string from the data ONLINE event. Populate your string into a global variable and call IP_Client_Open. When the ONLINE data event fires off, send the string(check the length of the string first).
Do a timed wait_until you recieve a response and then close the connection.
EDIT: Just realized someone above already said the same thing.