Sends server response.
@param response
2709
protected void sendServerResponse(HttpMessage response) {
        runner.http(action -> action.server(httpServer).send()
                .response(response.getStatusCode())
                .message(response));
    }
423638
private void writeNoContentResponse(final HttpServletResponse response) throws IOException {
		response.setStatus(HttpServletResponse.SC_NO_CONTENT);
		response.setContentType("image/gif");

		final PrintWriter out = response.getWriter();
		out.flush();
	}
968338
@Override
	public void write(T result, HttpServerRequest request, HttpServerResponse response) {

		if (result != null) {
			response.end(JsonUtils.toJson(result, io.vertx.core.json.Json.mapper));
		}
		else {
			response.end();
		}
	}
610821
private void reply(final String response, final boolean error,
            final String errorMessage, final String stackTrace,
            final String statusCode, final int statusCodeInt,
            Map<String, List<String>> responseHeaders) {

        if (!sentReply) {
            // must update sentReply first to avoid duplicated msg.
            sentReply = true;

            final ResponseOnSingeRequest res = new ResponseOnSingeRequest(
                    response, error, errorMessage, stackTrace, statusCode,
                    statusCodeInt, PcDateUtils.getNowDateTimeStrStandard(),
                    responseHeaders);
            if (!getContext().system().deadLetters().equals(sender)) {
                sender.tell(res, getSelf());
            }
            if (getContext() != null) {
                getContext().stop(getSelf());
            }
        }

    }
467386
public static void makeResponse(HttpResponse response, String msg, int status) {
        response.setStatusCode(status);
        makeStringResponse(response, msg);
    }
624480
public synchronized void sendResponse(BinaryResponse response) {
        if (pending == null) {
            pending = new LinkedList<ByteBuffer>();
        }
        pending.add(response.getBuffer());
    }
735100
public function sendResponse(ResponseInterface $response) : void
    {
        if (!headers_sent()) {
            $this->sendStatusLine($response);
            $this->sendHeaders($response);
        }
        $this->eventDispatcher->dispatch(new EventAfterAppReponseHeadersSending($response));
        $this->sendBody($response);
    }
205879
public void sendResponse(Response arg0) throws SipException, InvalidArgumentException {

        validateWrappedTransaction();

        final Dialog d = wrappedTransaction.getDialog();
        if (d != null) {
            final DialogWrapper dw = ra.getDialogWrapper(d);
            if (dw != null) {
                final int statusCode = arg0.getStatusCode();
                if (this.getRequest().getMethod().equals(Request.CANCEL) && (statusCode < 300 && statusCode > 199) && dw.getState() == null) {
                    dw.delete();
                } else if (d.getLocalTag() == null) {
                    // a new dialog which local tag is not yet known by jain sip stack, add the tag to the response 
                    try {
                        ((ToHeader) arg0.getHeader(ToHeader.NAME)).setTag(dw.getLocalTag());
                    } catch (ParseException e) {
                        throw new SipException(e.getMessage(), e);
                    }
                }
            }
        }

        if (tracer.isInfoEnabled()) {
            tracer.info(toString() + " sending response:\n" + arg0);
        }
        wrappedTransaction.sendResponse(arg0);
    }
1081840
protected function _sendResponse($response)
    {
        if (is_string($response)) {
            echo $response;

            return;
        }

        $emitter = new ResponseEmitter();
        $emitter->emit($response);
    }
515690
function(response) {
        var chunks = [];

        response.on('data', function(chunk) {
            chunks.push(chunk);
        });

        response.on('end', function() {
            var json = JSON.parse(chunks.join(''));
            this._showOutputInfo(json);
            this._handleOutput(json);
        }.bind(this));
    }
120663
public function sendResponseHttpHeaders(ResponseInterface $response):void
    {
        // checking
        if (headers_sent()) {
            throw new ResponseSenderException("A response has already been sent to the web browser",
                $this);
        }

        // removing PHP native HTTP headers (if enabled)
        if ($this->removePhpHttpHeaders) {
            foreach (headers_list() as $header) {
                header_remove(explode(":", $header)[0]);
            }
        }

        // sending response HTTP headers
        $this->sendHttpVersionHeader(
            $response->getProtocolVersion(),
            $response->getStatusCode(),
            $response->getReasonPhrase()
        );
        $this->sendHttpHeaders($this->listResponseHeaders($response));
    }
218388
private function sendResponse($response)
    {
        if ($response instanceof ResponseInterface) {
            $response->sendContent();
        } else {
            echo $this->response->send($response);
        }
    }
697066
public function send(Response $response = null)
    {
        if ($response) {
            $this->response = $response;
        }
        $this->response->prepare($this->request);
        $this->response->send();

        // If a cacheWrite callback exists execute
        // it now to write the image to the cache
        if (is_callable($this->cacheWrite)) {
            call_user_func_array(
                $this->cacheWrite,
                array($this->cache, $this->getCachePath())
            );
        }
    }
855656
function send_response() {
		$this->debug('Enter send_response');
		if ($this->fault) {
			$payload = $this->fault->serialize();
			$this->outgoing_headers[] = "HTTP/1.0 500 Internal Server Error";
			$this->outgoing_headers[] = "Status: 500 Internal Server Error";
		} else {
			$payload = $this->responseSOAP;
			// Some combinations of PHP+Web server allow the Status
			// to come through as a header.  Since OK is the default
			// just do nothing.
			// $this->outgoing_headers[] = "HTTP/1.0 200 OK";
			// $this->outgoing_headers[] = "Status: 200 OK";
		}
        // add debug data if in debug mode
		if(isset($this->debug_flag) && $this->debug_flag){
        	$payload .= $this->getDebugAsXMLComment();
        }
		$this->outgoing_headers[] = "Server: $this->title Server v$this->version";
		preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
		$this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
		// Let the Web server decide about this
		//$this->outgoing_headers[] = "Connection: Close\r\n";
		$payload = $this->getHTTPBody($payload);
		$type = $this->getHTTPContentType();
		$charset = $this->getHTTPContentTypeCharset();
		$this->outgoing_headers[] = "Content-Type: $type" . ($charset ? '; charset=' . $charset : '');
		//begin code to compress payload - by John
		// NOTE: there is no way to know whether the Web server will also compress
		// this data.
		if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) {	
			if (strstr($this->headers['accept-encoding'], 'gzip')) {
				if (function_exists('gzencode')) {
					if (isset($this->debug_flag) && $this->debug_flag) {
						$payload .= "<!-- Content being gzipped -->";
					}
					$this->outgoing_headers[] = "Content-Encoding: gzip";
					$payload = gzencode($payload);
				} else {
					if (isset($this->debug_flag) && $this->debug_flag) {
						$payload .= "<!-- Content will not be gzipped: no gzencode -->";
					}
				}
			} elseif (strstr($this->headers['accept-encoding'], 'deflate')) {
				// Note: MSIE requires gzdeflate output (no Zlib header and checksum),
				// instead of gzcompress output,
				// which conflicts with HTTP 1.1 spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.5)
				if (function_exists('gzdeflate')) {
					if (isset($this->debug_flag) && $this->debug_flag) {
						$payload .= "<!-- Content being deflated -->";
					}
					$this->outgoing_headers[] = "Content-Encoding: deflate";
					$payload = gzdeflate($payload);
				} else {
					if (isset($this->debug_flag) && $this->debug_flag) {
						$payload .= "<!-- Content will not be deflated: no gzcompress -->";
					}
				}
			}
		}
		//end code
		$this->outgoing_headers[] = "Content-Length: ".strlen($payload);
		reset($this->outgoing_headers);
		foreach($this->outgoing_headers as $hdr){
			header($hdr, false);
		}
		print $payload;
		$this->response = join("\r\n",$this->outgoing_headers)."\r\n\r\n".$payload;
	}
912430
@Override
    public void setResponse(T response) {
        if (!isTerminated()) {
            subject.onNext(response);
            valueSet.set(true);
            subject.onCompleted();
        } else {
            throw new IllegalStateException("Response has already terminated so response can not be set : " + response);
        }
    }
368054
private void writeResponse(final HttpServletResponse response, final String data) throws IOException {
    final byte[] outputBody = data.getBytes(StandardCharsets.UTF_8);
    response.getOutputStream().write(outputBody);
  }
1309785
public Mono<Void> send(GatewayMessage response) {
    return Mono.defer(
        () ->
            outbound
                .sendObject(Mono.just(response).map(codec::encode).map(TextWebSocketFrame::new))
                .then()
                .doOnSuccessOrError((avoid, th) -> logSend(response, th)));
  }