Ignore:
Timestamp:
May 23, 2017, 1:54:31 PM (2 years ago)
Author:
djay
Message:

Add support for headers definition to requests run from js ZOO-API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal_js.c

    r790 r828  
    934934  }else{
    935935    if(argc==3){
    936       char *body=JSValToChar(cx,&argv[2]);
    937       InternetOpenUrl(&hInternet,hInternet.waitingRequests[hInternet.nb],body,strlen(body),
    938                       INTERNET_FLAG_NO_CACHE_WRITE,0);
    939       processDownloads(&hInternet);
    940       free(body);
     936      if(strncasecmp(method,"GET",3)==0){
     937        header=JSVAL_TO_OBJECT(argv[2]);
     938        if(JS_IsArrayObject(cx,header)){
     939          setHeader(&hInternet,cx,header);
     940        }
     941        InternetOpenUrl(&hInternet,hInternet.waitingRequests[hInternet.nb],NULL,0,
     942                        INTERNET_FLAG_NO_CACHE_WRITE,0);
     943        processDownloads(&hInternet);
     944      }else{
     945        char *body=JSValToChar(cx,&argv[2]);
     946        InternetOpenUrl(&hInternet,hInternet.waitingRequests[hInternet.nb],body,strlen(body),
     947                        INTERNET_FLAG_NO_CACHE_WRITE,0);
     948        processDownloads(&hInternet);
     949        free(body);
     950      }
    941951    }else{
    942952      InternetOpenUrl(&hInternet,hInternet.waitingRequests[hInternet.nb],NULL,0,
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png