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
50
votes
7 answers

How to return an HTTP 500 code on any error, no matter what

I'm writing an authentication script in PHP, to be called as an API, that needs to return 200only in the case that it approves the request, and403(Forbidden) or500` otherwise. The problem I'm running into is that php returns 200 in the case of error…
Jake
  • 765
  • 1
  • 7
  • 12
50
votes
4 answers

Android Volley + JSONObjectRequest Caching

public class CustomRequest extends JsonObjectRequest { public CustomRequest(String url, JSONObject params, Listener listener, ErrorListener errorListener) throws JSONException { super(Method.POST,url,…
gaara87
  • 2,087
  • 3
  • 21
  • 43
44
votes
5 answers

How to display the request sent time and the response received time in Fiddler?

I'm working with Fiddler Web Debugger tool version 4.4.4.8. I've made a request to e.g. www.google.com and fiddler shows that a request is sent and the response is received. How could I know about and display when the request was sent and when the…
The Light
  • 26,341
  • 62
  • 176
  • 258
43
votes
7 answers

Putting detailed REST error message in HTTP Warning header, good/bad idea?

We are developing a standard REST service using HTTP status codes as its response code if something went wrong. (e.g. invalid user input would return "400 Bad Request" to the client) However, we felt that a more detailed error message would be…
Ibrahim Arief
  • 8,742
  • 6
  • 34
  • 54
43
votes
9 answers

node-express error : express deprecated res.send(status): Use res.sendStatus(status) instead

I am trying to send an integer via response.send() but I keep getting this error express deprecated res.send(status): Use res.sendStatus(status) instead I am not sending a Status, my code is app.get('/runSyncTest' , function(request, response){…
D-W-A
  • 551
  • 2
  • 7
  • 12
42
votes
3 answers

How do I capture a "response end" event in node.js+express?

I'd like to write an express middleware function that sets up a listener on the response's 'end' event, if one exists. The purpose is to do cleanup based on the http response code that the end handler decided to send, e.g. logging the response code…
Jake
  • 2,852
  • 7
  • 32
  • 39
40
votes
6 answers

HttpResponse.End vs HttpResponse.Close vs HttpResponse.SuppressContent

Within an ASPX page, I want to end the response at specific points (not due to an error condition), depending on code path, so that nothing else is sent back down the stream. So naturally used: Response.End(); This results in a…
AdaTheDev
  • 142,592
  • 28
  • 206
  • 200
40
votes
7 answers

Server response gets cut off half way through

I have a REST API that returns json responses. Sometimes (and what seems to be at completely random), the json response gets cut off half-way through. So the returned json string looks like: ...route_short_name":"135","route_long_name":"Secte // end…
samvermette
  • 40,269
  • 27
  • 112
  • 144
38
votes
3 answers

Website response time: Difference between `Load` and `Finish`

I needed to check a webpage's response time, so I visited the site on Chrome, opened Devtools and switched to the Network tab to check the response time: As you can see, there are two times: The first one is Finish and the second one is Load. I…
Novice_Developer
  • 1,432
  • 2
  • 19
  • 33
37
votes
7 answers

Xdebug stopped working, where do I look for errors?

I installed Xdebug and all was fine, until suddenly it stopped working. phpinfo() gives a nice XDebug output with all variables. php -m | grep deb also gives twice XDebug (for Zend and PHP), so again looks just fine. My php.ini has these lines:…
valk
  • 9,363
  • 12
  • 59
  • 79
37
votes
5 answers

Specifying filename for dynamic PDF in asp.net

How can I specify the filename when dumping data into the response stream? Right now I'm doing the following: byte[] data= GetFoo(); Response.Clear(); Response.Buffer = true; Response.ContentType = "application/pdf"; …
Josh Bush
  • 2,708
  • 4
  • 24
  • 25
35
votes
1 answer

New Response from Stream in Microsoft Edge

Does someone know of a way to create a new Response from a ReadableStream in Microsoft Edge? For Chrome, this is quite simple. You can just take a ReadableStream and pass it in the constructor of Response as the first argument. This way you can, for…
Erik
  • 2,888
  • 2
  • 18
  • 35
35
votes
9 answers

In Rails, how do you functional test a Javascript response format?

If your controller action looks like this: respond_to do |format| format.html { raise 'Unsupported' } format.js # index.js.erb end and your functional test looks like this: test "javascript response..." do get :index end it will execute the…
Teflon Ted
  • 8,696
  • 19
  • 64
  • 78
33
votes
2 answers

Symfony redirect to external URL

How can I redirect to an external URL within a symfony action? I tried this options : 1- return $this->redirect("www.example.com"); Error : No route found for "GET /www.example.com" 2- $this->redirect("www.example.com"); Error : The controller…
Saman Mohamadi
  • 4,454
  • 4
  • 38
  • 58
33
votes
3 answers

How to force a web browser to cache Images

I am writing a small application which serves images from the local computer, so they can be accessed as http://localhost:12345/something/something (which returns a jpeg). How can I force the browser to cache this, so only a single request would be…
The Unknown
  • 19,224
  • 29
  • 77
  • 93