Gilles Dufour Tue, 03/30/2010 - 09:03
User Badges:
  • Cisco Employee,

You can use one of the available script as an example :

CSS11503-2# sho script ap-kal-httptag
!no echo
! Filename: ap-kal-httptag
! Parameters: HostName WebPage HostTag
! Description:
!       This script will connect to the remote host and do an HTTP
!   GET method upon the web page that the user has asked for.
!   This script also adds a host tag to the GET request.
! Failure Upon:
!   1. Not establishing a connection with the host.
!       2. Not receiving an HTTP status "200 OK"

if ${ARGS}[#] "NEQ" "3"
        echo "Usage: ap-kal-httptag \'Hostname WebPage HostTag\'"
        exit script 1

! Defines:
set HostName "${ARGS}[1]"
set WebPage "${ARGS}[2]"
set HostTag "${ARGS}[3]"

! Connect to the remote Host
set EXIT_MSG "Connection Failure"
socket connect host ${HostName} port 80 tcp 2000

! Send the GET request for the web page
set EXIT_MSG "Send: Failed"
socket send ${SOCKET} "GET ${WebPage} HTTP/1.0\nHost: ${HostTag}\n\n"

! Wait for a good status code
set EXIT_MSG "Waitfor: Failed"
socket waitfor ${SOCKET} "200 OK" 2000

no set EXIT_MSG
socket disconnect ${SOCKET}

exit script 0

You can replace the line in red above with your own POST.

Take a sniffer trace from laptop to see what the post looks like and just insert it in the script above.



This Discussion