Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+6 -1
View File
@@ -269,11 +269,16 @@ class _Curl
* @return \IPS\Http\Response
* @throws \IPS\Http\Request\CurlException
*/
public function get()
public function get( $data=NULL )
{
/* Specify that this is a GET request */
curl_setopt( $this->curl, CURLOPT_HTTPGET, TRUE );
$this->dataForLog = NULL;
if ( $data )
{
curl_setopt( $this->curl, CURLOPT_POSTFIELDS, $data );
}
return $this->_executeAndFollowRedirects( 'GET', NULL );
}
+5 -4
View File
@@ -68,7 +68,7 @@ class _Sockets
$this->httpVersion = $httpVersion ?: '1.1';
$this->timeout = $timeout;
$this->followRedirects = $followRedirects;
/* Set our basic settings */
stream_context_set_option( $this->context, array(
'http' => array(
@@ -79,6 +79,7 @@ class _Sockets
),
'ssl' => array(
'verify_peer' => FALSE,
'crypto_method' => STREAM_CRYPTO_METHOD_ANY_CLIENT
)
) );
}
@@ -180,7 +181,7 @@ class _Sockets
/* Set the method and the Content-Length header if this is a POST, PUT or PATCH request */
stream_context_set_option( $this->context, 'http', 'method', $method );
if( in_array( $method, array( 'POST', 'PUT', 'PATCH' ) ) )
if( $data )
{
$this->setHeaders( array( 'Content-Length' => \strlen( $data ) ) );
}
@@ -192,7 +193,7 @@ class _Sockets
}
$hostname = sprintf( '%s%s:%d',
( $this->url->data['scheme'] === 'https' ) ? 'tls://' : '',
( $this->url->data['scheme'] === 'https' ) ? 'ssl://' : '',
$this->url->data['host'],
isset( $this->url->data['port'] )
? $this->url->data['port']
@@ -217,7 +218,7 @@ class _Sockets
/* Get the location */
$location = $this->url->data['path'] ? \IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_PATH, $this->url->data['path'] ) : '';
$location .= $this->url->data['query'] ? '?' . \IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_QUERY, $this->url->data['query'] ) : '';
$location .= ( count( $this->url->queryString ) ) ? '?' . \IPS\Http\Url::convertQueryAsArrayToString( $this->url->queryString, true ) : '';
$location .= $this->url->data['fragment'] ? '#' . \IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_FRAGMENT, $this->url->data['fragment'] ) : '';
/* Send request */