HTTP Post

i try to connect to a password protected webserver via http POST but don’t have a clue how to enter user/password in the field or how this actually works.

i have a app which can communicate with the webserver and the http sniffer gives me this:

POST /cmd.html HTTP/1.0
Host: 10.2.238.100
Accept: text/html, /
User-Agent: Mozilla/3.0 (compatible; Indy Library)
Content-Length: 4
Authorization: Basic YWRtaW46YWRtaW4=

P0=t

…i added the indy lib files to bin. passwort/user is admin which is probably encoded into this YWRtaW46YWRtaW4= ???
has anybody ever accessed a webserver via http post ?

btw. i try to get this working with vvvv (via ethernet).

If it is somehow possible try to use GET instead.
Also have a look here

cheers, i tried HTTP GET too…didn’t work BUT i have a solution now…

using commandline tool CURL

with following lines for turning ePower Switch 1G

ON
curl http://10.2.238.100/cmd.html -u admin:admin -data P0=1

OFF
curl http://10.2.238.100/cmd.html -u admin:admin -data P0=0

just in case someone uses this box too with vvvv

although there is a solution its still interesting what’s going wrong.

the HTTP GET node approach has this result in the HTTP Sniffer. Blue is request from vvvv and red the answer from the server. somehow the request is too slow and is interupted by the answer:

#003cff:GET /cmd.html?P0=.1 HTTP/1.1
Host: 10.2.238.100
Accept: text/html, /
User-Agent: Mozilla/5.0 (compatible; VVVV)

#ff0000:HTTP/1.1 401 Authorization Required
Cache-control: no-cache
Server: Cintech/1.1
Content-Length: 26
WWW-Authenticate: Basic realm=“Device Name”

~~#003cff:401 Authorization Required
GET /cmd.html?P0=.1 HTTP/1.1
Host: 10.2.238.100
Accept: text/html, /
User-Agent: Mozilla/5.0 (compatible; VVVV)
Authorization: Basic YWRtaW46YWRtaW4=
~~

and here is the CURL solution hence the sniffer Output:

~~#003cff:POST /cmd.html HTTP/1.0
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: curl/6.2 (win32) libcurl 6.2
Host: 10.2.238.100
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, /
Content-Length: 4
Content-Type: application/x-www-form-urlencoded

P0=1~~

#FF0000:HTTP/1.1 303 See Other
Cache-control: no-cache
Server: Cintech/1.1
Location: http://10.2.238.100/cmd.html

strange…

can you post your patch?

the patch contains nothing special…just the node and the login data…and produces the result above. the webserver answer before the login data can be send.

httpget.v4p (1.8 kB)