Announcement

Collapse
No announcement yet.

CGI script - Content type problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CGI script - Content type problem

    Hi,

    I have a Flex4 application which called a specific CGI script on XPort Pro (Evolution OS). My CGI is called, but the content type is equal at nothing ...

    /* Webmanager callback function. */
    static bool sampleWebMgrCallback(struct http_client *httpClient)
    {
    const char *contentType = HttpGetHeader(httpClient, "Content-Type");
    TLOG(TLOG_SEVERITY_DEBUG, contentType );

    ....

    From my Flex application, I wrote a standard POST request :

    var url:String = "http://10.22.98.195/sample";
    var request:URLRequest = new URLRequest(url);
    var requestVars:URLVariables = new URLVariables();
    requestVars.sa = "Submit";
    requestVars.translate = transmittext.text;
    request.data = requestVars;
    request.method = URLRequestMethod.POST;

    var urlLoader:URLLoader = new URLLoader();
    urlLoader = new URLLoader();
    urlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    urlLoader.addEventListener(Event.COMPLETE, loaderCompleteHandler, false, 0, true);

    urlLoader.load(request);


    Thank you very much for your help,

    Regards,

    Anthony

  • #2
    Hi Anthony,

    I have tested the HttpGetHeader() function with a simple HTML page
    It reports back NULL with GET and "application/x-www-form-urlencoded" with a POST request.
    Looking in the network trace I can see only a field Content-Type in the POST request, but none in the GET requerst. So the result of the HttpGetHeader() is correct

    Can you do a wireshark trace of your request in pcap format zip it and attache it to your answer

    Thanks

    Peter

    Lantronix FAE EMEA
    Lantronix FAE EMEA

    Comment

    Working...
    X