Questions tagged [response]

A response is a general term for a message which is sent as an answer for previously made request.

A response is a general term for a message which is sent as an answer for previously made request.

A request/response scheme is present in almost any communication protocol, particularly there message delivery is guaranteed, for example TCP, HTTP, etc.

Further Reading:

5919 questions
226
votes
3 answers

Guzzlehttp - How get the body of a response from Guzzle 6?

I'm trying to write a wrapper around an api my company is developing. It's restful, and using Postman I can send a post request to an endpoint like http://subdomain.dev.myapi.com/api/v1/auth/ with a username and password as POST data and I am given…
Greg
  • 6,453
  • 9
  • 45
  • 61
142
votes
10 answers

Returning JSON object as response in Spring Boot

I have a sample RestController in Spring Boot: @RestController @RequestMapping("/api") class MyRestController { @GetMapping(path = "/hello") public JSONObject sayHello() { return new JSONObject("{'aa':'bb'}"); } } I am using…
iwekesi
  • 2,228
  • 4
  • 19
  • 29
135
votes
2 answers

Python Flask Intentional Empty Response

Is there a way to return a response (from make_response() object or similar) with certain properties so that it doesn't render the page again and doesn't do anything else either. I am trying to run a code on the server without generating any output…
RukTech
  • 5,065
  • 5
  • 22
  • 23
132
votes
13 answers

continue processing php after sending http response

My script is called by server. From server I'll receive ID_OF_MESSAGE and TEXT_OF_MESSAGE. In my script I'll handle incoming text and generate response with params: ANSWER_TO_ID and RESPONSE_MESSAGE. The problem is that I'm sending response to…
user1700214
  • 1,375
  • 2
  • 9
  • 6
121
votes
20 answers

Remove Server Response Header IIS7

Is there any way to remove "Server" response header from IIS7? There are some articles showing that using HttpModules we can achieve the same thing. This will be helpful if we don't have admin right to server. Also I don't want to write ISAPI…
ram
112
votes
6 answers

What are Content-Language and Accept-Language?

I have seen the HTTP headers of Content-Language and Accept-Language, could someone explain what these are for and the difference between them? I have a multilingual site and wondering should I be setting both to the sites current selected language,…
amateur
  • 43,371
  • 65
  • 192
  • 320
110
votes
9 answers

java.lang.IllegalStateException: Cannot (forward | sendRedirect | create session) after response has been committed

This method throws java.lang.IllegalStateException: Cannot forward after response has been committed and I am unable to spot the problem. Any help? int noOfRows = Integer.parseInt(request.getParameter("noOfRows")); String chkboxVal = ""; …
102
votes
8 answers

Express.js Response Timeout

PROBLEM I've been looking for request/response timeouts for Express.js but everything seems to be related to the connection rather than the request/response itself. If a request is taking a long time, it should be timed out. Obviously this shouldn't…
Xerri
  • 4,916
  • 6
  • 45
  • 54
96
votes
7 answers

if-modified-since vs if-none-match

What could be the difference between if-modified-since and if-none-match? I have a feeling that if-none-match is used for files whereas if-modified-since is used for pages?
Tower
  • 98,741
  • 129
  • 357
  • 507
94
votes
5 answers

Download File from Bytes in JavaScript

I want to download the file which is coming in the form of bytes from the AJAX response. I tried to do it this way with the help of Blob: var blob=new Blob([resultByte], {type: "application/pdf"}); var…
Jahongir Rahmonov
  • 13,083
  • 10
  • 47
  • 91
81
votes
1 answer

Return generated pdf using spring MVC

I am using Spring MVC .I have to write a service that would take input from the request body, add the data to the pdf and returns the pdf file to the browser. The pdf document is generated using itextpdf. How can I do this using Spring MVC. I have…
Maheshwaran K
  • 1,982
  • 5
  • 19
  • 22
71
votes
16 answers

JQuery - Storing ajax response into global variable

Im still somewhat of a newbie on jQuery and the ajax scene, but I have an $.ajax request performing a GET to retrieve some XML files (~6KB or less), however for the duration the user spends on that page that XML content should not / will not change…
Dom
65
votes
6 answers

C# Encoding a text string with line breaks

I have a string I am writing to the outputstream of the response. After I save this document and open it in Notepad++ or WordPad I get nicely formatted line breaks where they are intended, but when I open this document with the regular old Windows…
jim
  • 26,598
  • 13
  • 51
  • 66
55
votes
3 answers

How to parse JSON from the Invoke-WebRequest in PowerShell?

When sending the GET request to the server, which uses self-signed certificate: add-type @" using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { public…
user52028778
  • 27,164
  • 3
  • 36
  • 42
54
votes
5 answers

What is the difference between response.sendRedirect() and request.getRequestDispatcher().forward(request,response)

I have got a problem with my page jump when I use JAVA, if I use: response.sendRedirect("login.jsp") then I get this url: http://localhost:8080/login.jsp But if I use request.getRequestDispathcer("login.jsp").forward(request, response) then I get…
roger
  • 9,063
  • 20
  • 72
  • 119
1
2 3
99 100