Prints a response tweet

@param response
The response tweet
171874
private static void logResponse(StatusUpdate response) {
		String text = response.getStatus();
		String message = String.format(MESSAGE_RESPONSE, text);
		System.out.println(message);
	}
650995
protected void printResults(PrintStream out) {
        log.debug("printResults()");
        StringBuilder line = new StringBuilder();
        out.println(line);
        out.println();
    }
759886
function (response) {
            response = JSON.parse(response).result;
            if (response.compilemessage) {
                results.push(response.compilemessage);
                callback({ results: results });
            } else {
                response.stderr.forEach(function (val, index, array) {
                    if (val === false) {
                        if (checker(response.stdout[index], answers[index])) {
                            results.push(true);
                        } else {
                            results.push(false);
                        }
                    } else {
                        results.push(val);
                    }
                });
                callback({
                    results: results,
                    message: response.message,
                    time: response.time,
                    casen: casen
                });
            }
        }
482911
public void sendResponse(int code, String response) {
        if(con.isClosed()) return;

        if(response == null || response.isEmpty()) {
            response = "Unknown";
        }

        try {
            if(response.charAt(0) == '-') {
                writer.write(code + response + "\r\n");
            } else {
                writer.write(code + " " + response + "\r\n");
            }
            writer.flush();
        } catch(IOException ex) {
            Utils.closeQuietly(this);
        }
        responseSent = true;
    }
466690
def print_tweets(tweets):
    
    print('=' * 60)
    for index, tweet in enumerate(tweets):
        print('-' * 60)
        print('Tweet {}:'.format(index))
        print('Username:', tweet[pytwis_constants.USERNAME_KEY])
        print('Time:',
              datetime.datetime.fromtimestamp(int(tweet[pytwis_constants.TWEET_UNIXTIME_KEY])).\
              strftime('%Y-%m-%d %H:%M:%S'))
        print('Body:\n\t', tweet[pytwis_constants.TWEET_BODY_KEY])
        print('-' * 60)
    print('=' * 60)
1272335
@Override
    public void handle(T result, HttpResponse response) {
        String expirationHeader =
            response.getHeaders().get(Headers.EXPIRATION);

        if ( expirationHeader != null ) {
            result.setExpirationTime(parseDate(expirationHeader));
            result.setExpirationTimeRuleId(parseRuleId(expirationHeader));
        }
    }
1176148
public void handleResponse(String response) {
        if (messageListener != null) {
            log.debug("Sending Http response");
            messageListener.onOutboundMessage(new RawMessage(response), null);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Sending Http response:" + NEWLINE + response);
            }
        }
    }
232721
private void writeMessage(final HttpServletResponse response, final String message, final int status)
      throws IOException {
    response.getWriter().println(message);
    response.setStatus(status);
  }
554487
private void respond(BufferedWriter out, String response) throws IOException {
        out.append(response);
        out.append("\n");
        out.flush();
    }
53369
public static void returnStatusResponse(HttpServletResponse response, int status, String message) {
		if (response == null) {
			return;
		}
		PrintWriter out = null;
		try {
			response.setStatus(status);
			response.setContentType(MediaType.APPLICATION_JSON);
			out = response.getWriter();
			ParaObjectUtils.getJsonWriter().writeValue(out, getStatusResponse(Response.Status.
					fromStatusCode(status), message).getEntity());
		} catch (Exception ex) {
			logger.error(null, ex);
		} finally {
			if (out != null) {
				out.close();
			}
		}
	}
470471
def _write_response(self, response):
        
        status = '{} {} {}\r\n'.format(response['version'],
                                       response['code'],
                                       responses[response['code']])
        self.logger.debug("Responding status: '%s'", status.strip())
        self._write_transport(status)

        if 'body' in response and 'Content-Length' not in response['headers']:
            response['headers']['Content-Length'] = len(response['body'])

        response['headers']['Date'] = datetime.utcnow().strftime(
            "%a, %d %b %Y %H:%M:%S +0000")

        for (header, content) in response['headers'].items():
            self.logger.debug("Sending header: '%s: %s'", header, content)
            self._write_transport('{}: {}\r\n'.format(header, content))

        self._write_transport('\r\n')
        if 'body' in response:
            self._write_transport(response['body'])
1193818
public function output($response)
    {
        //argument 1 should be an array or ArrayAccess
        Argument::i()->test(1, 'array', 'ArrayAccess');
        
        $code = $response['code'];
        $headers = $response['headers'];
        $body = $response['body'];
        
        if (is_int($code)) {
            http_response_code($code);
        }
        
        if (!isset($headers['Content-Type']) && !isset($headers['content-type'])) {
            $headers['Content-Type'] = 'text/html; charset=utf-8';
        }
        
        if (!$body) {
            $body = '';
        }
        
        //if it's not scalar
        if (!is_scalar($body)) {
            $body = json_encode($body, JSON_PRETTY_PRINT);
        }
        
        foreach ($headers as $name => $value) {
            if (!$value) {
                header($name);
                continue;
            }
            
            header($name.':'.$value);
        }

        $check = new \StdClass();
        $check->stop = false;

        $this->trigger('server-output', $response, $body, $check);
        
        if (!$check->stop) {
            echo (string) $body;
            $this->successful = true;
        }
        
        return $this;
    }
1161579
@Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    JsonGenerator jg = null;
    String jsonpcb = null;
    PrintWriter writer = null;
    try {

      writer = response.getWriter();

      // "callback" parameter implies JSONP output
      jsonpcb = request.getParameter(CALLBACK_PARAM);
      if (jsonpcb != null) {
        response.setContentType("application/javascript; charset=utf8");
        writer.write(jsonpcb + "(");
      } else {
        response.setContentType("application/json; charset=utf8");
      }

      jg = jsonFactory.createJsonGenerator(writer);
      jg.disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
      jg.useDefaultPrettyPrinter();

      int statusCode = renderMBeans(jg, request.getParameterValues("qry"));
      response.setStatus(statusCode);

    } catch (IOException e) {
      writeException(jg, e);
      response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    } catch (MalformedObjectNameException e) {
      writeException(jg, e);
      response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
    } finally {
      if (jg != null) {
        jg.close();
      }
      if (jsonpcb != null) {
        writer.write(");");
      }
      if (writer != null) {
        writer.close();
      }
    }

  }
305408
public static String getResponseCodeOutput(Response response) {
        if (response == null) {
            return "";
        }
        StringBuilder responseOutput = new StringBuilder();
        String uuid = getUUID();
        responseOutput.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Response Status Code</a> ");
        responseOutput.append(SPAN_ID).append(uuid).append(DISPLAY_NONE);
        responseOutput.append(DIV).append(response.getCode()).append(END_DIV);
        responseOutput.append(END_SPAN);
        return responseOutput.toString();
    }
803866
private static void debug(String header, HttpResponse response) {
	if (logger.isTraceEnabled()) {
	    logger.trace(header);
	    logger.trace(response.toString());
	}
    }
577009
public static void main(String[] args) {
        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.tweets.UploadMultipleImages [text] [file1] [file2] ...");
            System.exit(-1);
        }
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            
            long[] mediaIds = new long[args.length-1];
            for (int i=1; i<args.length; i++) {
                System.out.println("Uploading...[" + i + "/" + (args.length-1) + "][" + args[i] + "]");
                UploadedMedia media = twitter.uploadMedia(new File(args[i]));
                System.out.println("Uploaded: id=" + media.getMediaId()
                        + ", w=" + media.getImageWidth() + ", h=" + media.getImageHeight()
                        + ", type=" + media.getImageType() + ", size=" + media.getSize());
                mediaIds[i-1] = media.getMediaId();
            }
            
            StatusUpdate update = new StatusUpdate(args[0]);
            update.setMediaIds(mediaIds);
            Status status = twitter.updateStatus(update);
            System.out.println("Successfully updated the status to [" + status.getText() + "][" + status.getId() + "].");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to update status: " + te.getMessage());
            System.exit(-1);
        }
    }
1295251
@Override
    public void emitResponse(T response) {
        if (!isTerminated()) {
            subject.onNext(response);
            valueSet.set(true);
        } else {
            throw new IllegalStateException("Response has already terminated so response can not be set : " + response);
        }
    }