original_string: protected function request($url, $options = array(), $acceptheader = 'application/json') {
          $murl = new moodle_url($url);
  
          if ($this->accesstoken) {
              if ($this->use_http_get()) {
                  // If using HTTP GET add as a parameter.
                  $murl->param('access_token', $this->accesstoken->token);
              } else {
                  $this->setHeader('Authorization: Bearer '.$this->accesstoken->token);
              }
          }
  
          if ($acceptheader) {
              $this->setHeader('Accept: ' . $acceptheader);
          }
  
          $response = parent::request($murl->out(false), $options);
  
          $this->resetHeader();
  
          return $response;
      }
code: protected function request($url, $options = array(), $acceptheader = 'application/json') {
          $murl = new moodle_url($url);
  
          if ($this->accesstoken) {
              if ($this->use_http_get()) {
                  // If using HTTP GET add as a parameter.
                  $murl->param('access_token', $this->accesstoken->token);
              } else {
                  $this->setHeader('Authorization: Bearer '.$this->accesstoken->token);
              }
          }
  
          if ($acceptheader) {
              $this->setHeader('Accept: ' . $acceptheader);
          }
  
          $response = parent::request($murl->out(false), $options);
  
          $this->resetHeader();
  
          return $response;
      }
code_tokens: protected function request ( $ url , $ options = array ( ) , $ acceptheader = 'application/json' ) { $ murl = new moodle_url ( $ url ) ; if ( $ this -> accesstoken ) { if ( $ this -> use_http_get ( ) ) { // If using HTTP GET add as a parameter. $ murl -> param ( 'access_token' , $ this -> accesstoken -> token ) ; } else { $ this -> setHeader ( 'Authorization: Bearer ' . $ this -> accesstoken -> token ) ; } } if ( $ acceptheader ) { $ this -> setHeader ( 'Accept: ' . $ acceptheader ) ; } $ response = parent :: request ( $ murl -> out ( false ) , $ options ) ; $ this -> resetHeader ( ) ; return $ response ; }
docstring: Make a HTTP request, adding the access token we have
  
  @param string $url The URL to request
  @param array $options
  @param mixed $acceptheader mimetype (as string) or false to skip sending an accept header.
  @return bool
docstring_tokens: Make a HTTP request adding the access token we have