Get the http status code for the response
171428
def status_code(self):
        
        try:
            return self._status_code
        except AttributeError:
            self._status_code = self._response.getcode()
        return self._status_code
382811
def get_status(self, response, finished=False):
        """"""
        for line in response.split("\n"):
            if line.strip() in self.status_mapping:
                return self.status_mapping[line.strip()]
        return None
1259856
def check_response_status(self, response):
        
        if not (200 <= response.status_code < 300):
            try:
                message = response.json()["errors"]
            except Exception:
                message = None
            floyd_logger.debug("Error received : status_code: {}, message: {}".format(response.status_code,
                                                                                      message or response.content))
            if response.status_code == 400:
                raise BadRequestException(response)
            elif response.status_code == 401:
                raise AuthenticationException()
            elif response.status_code == 403:
                raise AuthorizationException(response)
            elif response.status_code == 404:
                raise NotFoundException()
            elif response.status_code == 429:
                raise OverLimitException(response.json().get("message"))
            elif response.status_code == 502:
                raise BadGatewayException()
            elif response.status_code == 504:
                raise GatewayTimeoutException()
            elif response.status_code == 423:
                raise LockedException()
            elif 500 <= response.status_code < 600:
                if 'Server under maintenance' in response.content.decode():
                    raise ServerException('Server under maintenance, please try again later.')
                else:
                    raise ServerException()
            else:
                msg = "An error occurred. Server response: {}".format(response.status_code)
                raise FloydException(message=msg)
790176
public function getStatus()
    {
        $request = $this->apiRequestFactory->createRequest('GET', $this->getBaseUri() . '/status/CLEAN');
        $response = $this->httpClient->sendRequest($request);

        return $response->getStatusCode() === 200;
    }
815941
public function getHttpResponseCodeText()
    {
        $code = $this->getHttpResponseCode();
        $statusTexts = \Symfony\Component\HttpFoundation\Response::$statusTexts;

        return (isset($statusTexts[$code])) ? $statusTexts[$code] : null;
    }
1226096
def request_status(r, detailed=False):
	
	
	base_string = "HTTP {r.request.method} {r.request.url}: {r.status_code}"
	
	if r.status_code in range(200,99):
		string = base_string
		if detailed is True:
			string += " - {r.json()}"
		else:
			string += " - 👍"
		return string.format(r=r)
	else:
		string = base_string
		return string.format(r=r)
834324
private HttpCode readStatusLine() throws IOException {
        // Read a line of text, which should be in the format HTTP/<version <code> <reason>
        String statusLine = readHeader();
        String[] parts = statusLine.split(" +");
        if (parts.length < 3) {
            throw new IOException("Badly formed response status line: " + statusLine);
        }
        try {
            // Attempt to convert the return code into an enum.
            int code = Integer.parseInt(parts[1]);
            HttpCode result = HttpCode.findByCode(code);
            if (result == null) {
                throw new IOException("Unrecognized result code: " + code);
            }
            return result;
        } catch (NumberFormatException e) {
            // Turn into a bad response line error.
            throw new IOException("Badly formed response status line: " + statusLine);
        }
    }
1110604
private boolean simulateHttpStatusCode(Message replyMessage) throws IOException {
        if (replyMessage == null || CollectionUtils.isEmpty(replyMessage.getHeaders())) {
            return false;
        }
        
        for (Entry<String, Object> headerEntry : replyMessage.getHeaders().entrySet()) {
            if (headerEntry.getKey().equalsIgnoreCase(SoapMessageHeaders.HTTP_STATUS_CODE)) {
                WebServiceConnection connection = TransportContextHolder.getTransportContext().getConnection();
                
                int statusCode = Integer.valueOf(headerEntry.getValue().toString());
                if (connection instanceof HttpServletConnection) {
                    ((HttpServletConnection)connection).setFault(false);
                    ((HttpServletConnection)connection).getHttpServletResponse().setStatus(statusCode);
                    return true;
                } else {
                    log.warn("Unable to set custom Http status code on connection other than HttpServletConnection (" + connection.getClass().getName() + ")");
                }
            }
        }
        
        return false;
    }
306192
public HttpStatus getStatusCode() {
        final Object statusCode = getHeader(HttpMessageHeaders.HTTP_STATUS_CODE);

        if (statusCode != null) {
            if (statusCode instanceof HttpStatus) {
                return (HttpStatus) statusCode;
            } else if (statusCode instanceof Integer) {
                return HttpStatus.valueOf((Integer) statusCode);
            } else {
                return HttpStatus.valueOf(Integer.valueOf(statusCode.toString()));
            }
        }

        return null;
    }
415709
def status(self):
        """"""
        status = self.receiver.status(self)
        return status if status else (
            self.response_code, self.response.get('message')
        )
1251718
def checkResponse(request):
        '''
        
        '''

        # Check the status code of the returned request
        if str(request.status_code)[0] not in ['2', '3']:
            w = str(request.text).split('\\r')[0][2:]
            raise InvalidRequest(w)
        return
799380
def status(self, request, project, pk=None):
        
        try:
            push = Push.objects.get(id=pk)
        except Push.DoesNotExist:
            return Response("No push with id: {0}".format(pk),
                            status=HTTP_404_NOT_FOUND)
        return Response(push.get_status())
824597
def status(self, status, headers=None):
        '''
        
        '''
        self.response = _Response(status, headers)
        return self
379480
private function getStatus()
    {
        if (!($statusArray = preg_grep('/^HTTP\/(1.0|1.1)\s+(\d+)\s+(.+)/', $this->headers))) {
            throw new \RuntimeException('Could not determine HTTP status from API response');
        }

        if (!preg_match('/^HTTP\/(1.0|1.1)\s+(\d+)\s+(.+)/', $statusArray[0], $matchesArray)) {
            throw new \RuntimeException('Could not determine HTTP status from API response');
        }

        return array(
            'code' => $matchesArray[2],
            'message' => $matchesArray[3],
        );
    }
88397
def get_status
      status = @http.aget(PredictionIO::AsyncRequest.new('/')).get
      begin
        status.body
      rescue
        status
      end
    end
432645
public int getHTTPStatus() throws InterruptedException, BOSHException {
        if (toThrow != null) {
            throw(toThrow);
        }
        lock.lock();
        try {
            if (!sent) {
                awaitResponse();
            }
        } finally {
            lock.unlock();
        }
        return statusCode;
    }
1015309
def _get_response(**kwargs):
    
    if 'code' not in kwargs:
        kwargs['code'] = 200
    if 'headers' not in kwargs:
        kwargs['headers'] = dict()
    if 'version' not in kwargs:
        kwargs['version'] = 'HTTP/1.1'

    return dict(**kwargs)