httpresponse.js

来自「Browser independent JavaScript SDK. Clas」· JavaScript 代码 · 共 76 行

JS
76
字号
/* * JavaScript Software Development Kit - what JavaScript should be and can be - js-sdk.sourceforge.net * Copyright (C) 2006-2007 Mathew Sheets * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL") *    http://www.gnu.org/licenses/lgpl.html * * == END LICENSE == */package jsx.io.http;import jsx.io.http.DefaultResponse;class HttpResponse extends DefaultResponse{	/**	* @fileOverview	* @example	*/	/**	* @class HttpResponse	* @constructor	*/	HttpResponse(_transport)	{		this.transport = _transport;		this.xml = this.transport.responseXML;		this.text = this.transport.responseText;		this.statusCode = this.transport.status;		this.statusText = this.transport.statusText;	}	instance getXml()	{		return this.xml;	}	instance getText()	{		return this.text;	}	instance getStatusCode()	{		return this.statusCode;	}	instance getStatusText()	{		return this.statusText;	}	instance getAllHeaders()	{		return this.transport.getAllResponseHeaders();	}	instance getHeader(_name)	{		return this.transport.getResponseHeader(_name)	}	instance isSuccess()	{		return !this.statusCode || (this.statusCode >= 200 && this.statusCode < 300);	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?