Mini Shell

Direktori : /home/admin/web/mcpv.demarco.ddnsfree.com/public_html/wp-includes/Requests/src/
Upload File :
Current File : /home/admin/web/mcpv.demarco.ddnsfree.com/public_html/wp-includes/Requests/src/Response.php

<?php
/**
 * HTTP response class
 *
 * Contains a response from \WpOrg\Requests\Requests::request()
 *
 * @package Requests
 */

namespace WpOrg\Requests;

use WpOrg\Requests\Cookie\Jar;
use WpOrg\Requests\Exception;
use WpOrg\Requests\Exception\Http;
use WpOrg\Requests\Response\Headers;

/**
 * HTTP response class
 *
 * Contains a response from \WpOrg\Requests\Requests::request()
 *
 * @package Requests
 */
class Response {

	/**
	 * Response body
	 *
	 * @var string
	 */
	public $body = '';

	/**
	 * Raw HTTP data from the transport
	 *
	 * @var string
	 */
	public $raw = '';

	/**
	 * Headers, as an associative array
	 *
	 * @var \WpOrg\Requests\Response\Headers Array-like object representing headers
	 */
	public $headers = [];

	/**
	 * Status code, false if non-blocking
	 *
	 * @var integer|boolean
	 */
	public $status_code = false;

	/**
	 * Protocol version, false if non-blocking
	 *
	 * @var float|boolean
	 */
	public $protocol_version = false;

	/**
	 * Whether the request succeeded or not
	 *
	 * @var boolean
	 */
	public $success = false;

	/**
	 * Number of redirects the request used
	 *
	 * @var integer
	 */
	public $redirects = 0;

	/**
	 * URL requested
	 *
	 * @var string
	 */
	public $url = '';

	/**
	 * Previous requests (from redirects)
	 *
	 * @var array Array of \WpOrg\Requests\Response objects
	 */
	public $history = [];

	/**
	 * Cookies from the request
	 *
	 * @var \WpOrg\Requests\Cookie\Jar Array-like object representing a cookie jar
	 */
	public $cookies = [];

	/**
	 * Constructor
	 */
	public function __construct() {
		$this->headers = new Headers();
		$this->cookies = new Jar();
	}

	/**
	 * Is the response a redirect?
	 *
	 * @return boolean True if redirect (3xx status), false if not.
	 */
	public function is_redirect() {
		$code = $this->status_code;
		return in_array($code, [300, 301, 302, 303, 307], true) || $code > 307 && $code < 400;
	}

	/**
	 * Throws an exception if the request was not successful
	 *
	 * @param boolean $allow_redirects Set to false to throw on a 3xx as well
	 *
	 * @throws \WpOrg\Requests\Exception If `$allow_redirects` is false, and code is 3xx (`response.no_redirects`)
	 * @throws \WpOrg\Requests\Exception\Http On non-successful status code. Exception class corresponds to "Status" + code (e.g. {@see \WpOrg\Requests\Exception\Http\Status404})
	 */
	public function throw_for_status($allow_redirects = true) {
		if ($this->is_redirect()) {
			if ($allow_redirects !== true) {
				throw new Exception('Redirection not allowed', 'response.no_redirects', $this);
			}
		} elseif (!$this->success) {
			$exception = Http::get_class($this->status_code);
			throw new $exception(null, $this);
		}
	}

	/**
	 * JSON decode the response body.
	 *
	 * The method parameters are the same as those for the PHP native `json_decode()` function.
	 *
	 * @link https://php.net/json-decode
	 *
	 * @param ?bool $associative Optional. When `true`, JSON objects will be returned as associative arrays;
	 *                           When `false`, JSON objects will be returned as objects.
	 *                           When `null`, JSON objects will be returned as associative arrays
	 *                           or objects depending on whether `JSON_OBJECT_AS_ARRAY` is set in the flags.
	 *                           Defaults to `true` (in contrast to the PHP native default of `null`).
	 * @param int   $depth       Optional. Maximum nesting depth of the structure being decoded.
	 *                           Defaults to `512`.
	 * @param int   $options     Optional. Bitmask of JSON_BIGINT_AS_STRING, JSON_INVALID_UTF8_IGNORE,
	 *                           JSON_INVALID_UTF8_SUBSTITUTE, JSON_OBJECT_AS_ARRAY, JSON_THROW_ON_ERROR.
	 *                           Defaults to `0` (no options set).
	 *
	 * @return array
	 *
	 * @throws \WpOrg\Requests\Exception If `$this->body` is not valid json.
	 */
	public function decode_body($associative = true, $depth = 512, $options = 0) {
		$data = json_decode($this->body, $associative, $depth, $options);

		if (json_last_error() !== JSON_ERROR_NONE) {
			$last_error = json_last_error_msg();
			throw new Exception('Unable to parse JSON data: ' . $last_error, 'response.invalid', $this);
		}

		return $data;
	}
}
December 29, 2020 – Page 2 – Base de données MCPV "Prestataires"

Day: December 29, 2020

Slip the lengthy straps beneath your mattress (it’s easier

Grownup Sex Toys Purchase Over Four,000 Adult Objects For Men & Ladies Something that stood out during testing was the well-thought-out measurement. The 4-inch lengthy prober supplied a great steadiness in order that the sensations have been intense while still accommodative. The bulbous physique was straightforward to insert, and the widening shape made the sensations…

Read More

If you do not need us to course of your sensitive information

Privacy Coverage We use quite lots of industry-standard security technologies and procedures to assist defend your knowledge from unauthorized entry, use, or disclosure. The Services permit you to enter info that could be delicate and subject to special protections underneath applicable legal guidelines. This section explains how we use and protect delicate info. If we…

Read More

While the size may not be beginner-friendly

Buy Squishy & Gentle Dildos I think the torque-oriented rumbles may not be for you when you have a sensitive clitoris. Especially with the hands-free using mode Gauge Penis Pump – Pull Rod, you can take pleasure in vaginal stimulation and use one other sex toy to enhance the expertise with clit stimulation. This is…

Read More

Glass intercourse toys are generally created from clear

The 4 Greatest Intercourse Toys For Seniors Lichee Pattern Wrist to Neck Restraint, In Accordance With Intercourse Therapists Check that the brand helps gadget unpairing and user account administration. Yes—cloud-connected fashions allow you to sync disconnected distances, so long as both parties have secure web Men’s Wrestling Singlet Mankini, app entry, and the toy paired…

Read More

If you want to engage in slightly backdoor action

Most Trusted Sex Toy Retailer Sextoy Com Grownup Toy Shop If you are ready to move on to extra abstract dildos, there are many options, as they arrive in many fantastical sizes and shapes, including ones with glitter, beads and totally different textures, to enchantment to your wishes. “Silicone or glass dildos are the very…

Read More

We’ve picked out our favourite designer handbag dupes for

How To Spot A Pretend Designer Handbag, According To Professional Authenticators Here are just some of the top pros and cons of replica designer purses that can assist you to determine whether this buy is best for you or not. With the event of e-commerce replica bags, buying replicas of designer merchandise has turn into…

Read More

Heritage-bags supply precise replica versions of luxury

Genuine & Reproduction Purse Reviews By The Purse Queen However, there are also Reddit threads devoted to the best sellers. Typically, baggage are made to order and the vendor sends quality-control pictures throughout the method. I will share high picks and recommendations on recognizing high-quality bag dupes that will elevate your style with out the…

Read More

But these smaller, extra intimate coteries go beyond a shared

The Surge Of ‘superfake’ Purses Is Among Us Give your wardrobe a refresh and add a Givenchy Antigona soft leather bag proper now, and examine out the other dupe again ranges too. This is where it turns into necessary to have the ability to distinguish between an affordable knock-off and high-quality Gucci replicas. A replica…

Read More

Various luxurious manufacturers have foundries in China

Spot Fake Ysl Bag Like A Pro: What You Have To Know This could be very bad for the long-term development of your corporation. Another retailer created by Chinese entrepreneurs with ridiculous prices, if you know how to look, on gadgets with features and qualities virtually equal to those of the unique merchandise. Of course,…

Read More

Perhaps one of the most underrated discreet sex toys is nipple

Which is the best wand vibrator? Hitachi vs Le Wand vs. Doxy You can also find out what types of lubricants can be used with the toy to enhance the experience. Designed to be compact in size, all mini vibrators are used to stimulate the genitals to increase arousal and to promote intense climaxes. These…

Read More