You are here

function zopim_post_request in Zopim Live Chat 6.2

2 calls to zopim_post_request()
zopim_admin_settings_form_validate in includes/zopim-account.admin.inc
zopim_get_account_details in ./zopim.module

File

./zopim.module, line 268

Code

function zopim_post_request($url, $data, $ssl = NULL) {
  $ssl = $ssl ? $ssl : variable_get('zopim_use_ssl', '1');
  $headers = array(
    'Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8',
  );
  $url = $ssl === 1 ? $url : str_replace("https", "http", $url);
  $data = drupal_query_string_encode($data);
  $request = drupal_http_request($url, $headers, 'POST', $data);
  return drupal_parse_json($request->data);
}