Changeset 292

Show
Ignore:
Timestamp:
06/03/10 12:05:25 (20 months ago)
Author:
ol
Message:

Handle both POST and GET query on HTTP mode

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/test/unit_test

    r291 r292  
    7878    fi 
    7979    IP=`grep online_resource $TINYOWS_CONFIG_FILE | sed -e 's/.*online_resource="//' -e 's/".*//'` 
    80     curl -i -H "Content-Type: text/xml" --data @$unit_id $IP 
     80    FIRST_CHAR=`cat $unit_id | sed 's/\(.\).*/\1/'` 
     81    if [ $FIRST_CHAR = "<" ]; then 
     82        curl -i -H "Content-Type: text/xml" --data @$unit_id $IP 
     83    else 
     84        QUERY=`cat $unit_id` 
     85        curl -i "$IP?$QUERY" 
     86    fi 
    8187 
    8288# Exception mode