Thanks for this nice module! I only have one question about the usage in my scenario.
I have a Drupal service user login resource. The login against this service works fine. The service returns the user object as JSON and in this object I have a session_name and sessid. They should be added to a cookie string and send with the curl request.
But currently I dont get this woirking without adding the cookie string manually in the code so the function feeds_httpfetcher_aa_request_get looks like

if ($auth_post_format == 'json') {
        //set the values as cookies
        $cookie_string = $auth_credentials['session_name'].'='.$auth_credentials['sessid'];
        
        if ($cookie_string) {
          curl_setopt($download, CURLOPT_COOKIE, $cookie_string);
        }      
      
        $auth_credentials = json_encode($auth_credentials);
        curl_setopt($download, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($download, CURLOPT_POSTFIELDS, $auth_credentials);        
        curl_setopt($download, CURLOPT_HTTPHEADER, array(
            'Content-Type: application/json',
            'Content-Length: ' . strlen($auth_credentials))
        );
      }

Any idea how to send the cookie in the fetch request without this hack?

Comments

jwjoshuawalker’s picture

@manuelBS

Is this the same as: #2138303: Drupal Random Session Cookie Support in Feeds HTTPFetcher AA? ?

Looking for a way to get the random session var's key (not value)?