diff --git a/fulcrm_apiv2.module b/fulcrm_apiv2.module index 92589cb..0018154 100644 --- a/fulcrm_apiv2.module +++ b/fulcrm_apiv2.module @@ -61,6 +61,15 @@ function fulcrm_apiv2_url_is_type( $url, $type ) { return false; } +function fulcrm_apiv2_make_url( $type, $id = null ) { + $url = 'https://' . variable_get( 'fulcrm_apiv2_hostname', 'fulcrm.org' ) . '/api/v2/' . $type . '/'; + + if ( $id !== null ) + $url .= $id . '/'; + + return $url; +} + function fulcrm_apiv2_http( $method, $object = null, $data = null, $query = null ) { $url = null; @@ -104,7 +113,6 @@ function fulcrm_apiv2_http( $method, $object = null, $data = null, $query = null $request_headers[] = 'Content-Type: application/json'; } curl_setopt( $curl, CURLOPT_POSTFIELDS, $data ); - $request_headers[] = 'Content-Length: ' . strlen( $data ); } $incoming_client_ids = &drupal_static( 'fulcrm_apiv2_prevent_loop' );