Questions tagged [httpresponse]

An HTTP response is a network message which is made of a body and metadata in the form of headers, according to HTTP specification. May also refer an HttpResponse class in software frameworks and libraries that automates relevant functionality

From W3C specification:

   Response      = Status-Line               ;
                   *(( general-header        ;
                    | response-header        ;
                    | entity-header ) CRLF)  ;
                   CRLF
                   [ message-body ]          ;

See also:

3825 questions
22
votes
4 answers

Setting Content-Type in Django HttpResponse object for Shopify App

I'm working on a Shopify app using Django, which I am hosting on a VPS with nginx and gunicorn. I am trying to change the Content-Type of an HttpResponse object to application/liquid, so that I can use Shopify's application proxy feature, but it…
winter
  • 273
  • 1
  • 2
  • 9
22
votes
5 answers

Checking HttpResponse OK (200) with Selenium WebDriver

I am using Selenium Remote WebDriver. I read all links from csv file and run test against those links. But sometimes I get 404 response. Is there any way in Selenium WebDriver to check that we get HTTP response 200?
Aniruddha
  • 3,513
  • 6
  • 27
  • 38
20
votes
2 answers

Is there a limit of the size of response I can read over HTTP

I have a java program, that calls a url. The response of url is a json/string. I have to write a program that fetches the data from this url, but I was wondering if there's a limit on the max size HTTP can pass back? I was going to write my server…
Kraken
  • 23,393
  • 37
  • 102
  • 162
20
votes
3 answers

What HTTP status code for unactivated account?

Which HTTP status code should I respond with after authenticating the user and then finding out that they have not activated their account after registration?
Johnathan Au
  • 5,244
  • 18
  • 70
  • 128
20
votes
3 answers

How to delete the file that was sent as StreamContent of HttpResponseMessage

In ASP.NET webapi, I send a temporary file to client. I open a stream to read the file and use the StreamContent on the HttpResponseMessage. Once the client receives the file, I want to delete this temporary file (without any other call from the…
Bhanu Gotluru
  • 235
  • 2
  • 7
20
votes
1 answer

Most appropriate HTTP status code for "job in progress"

What is the most appropriate HTTP status code to give to a client to mean "your request is fine, but it is still in progress; check back shortly in the exact same place." For example, say the client submits an initial request to start a heavy…
kes
  • 5,983
  • 8
  • 41
  • 69
19
votes
7 answers

No Source Code is available for type : GWT Compilation Error

I am trying to make get requests by a servlet in my GWT application. On compiling the code I am getting these errors. [ERROR] Line 16: No source code is available for type org.apache.http.client.ClientProtocolException; did you forget to inherit a…
Saurabh Saxena
  • 3,005
  • 10
  • 31
  • 46
19
votes
5 answers

When an ASP.NET System.Web.HttpResponse.End() is called, the current thread is aborted?

when a System.Web.HttpResponse.End() is called a System.Thread.Abort is being fired, which i'm guessing is (or fires) an exception? I've got some logging and this is being listed in the log file... A first chance exception of type…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
18
votes
1 answer

Make Django return response as a "different filename"

I have a Django view which returns an HttpResponse with a special MIME type to make the user's browser "download" the file instead of view it in the browser. The problem is that the default filename that the response will be saved as is the URL…
Deniz Dogan
  • 25,711
  • 35
  • 110
  • 162
18
votes
2 answers

Angular $http service - force not parsing response to JSON

I have a "test.ini" file in my server, contain the following text: "[ALL_OFF] [ALL_ON] " I'm trying to get this file content via $http service, here is part of my function: var params = { url: 'test.ini'}; $http(params).then( …
cheziHoyzer
  • 4,803
  • 12
  • 54
  • 81
17
votes
2 answers

why is golang http server failing with "broken pipe" when response exceeds 8kb?

I have a example web server below where if you call curl localhost:3000 -v then ^C (cancel) it immediately (before 1 second), it will report write tcp 127.0.0.1:3000->127.0.0.1:XXXXX: write: broken pipe. package main import ( "fmt" …
eldosoa
  • 303
  • 1
  • 2
  • 9
17
votes
2 answers

HTTP 444 (No Response) instead of 404, 403 error pages?

I always use "return 444" in the nginx config to stop crawlers that access my servers directly via IP or via the wrong hostname. It just closes the connection. Perfect. Now I want to use this response instead of the standard 404.html pages that…
Howard
  • 266
  • 1
  • 3
  • 14
17
votes
1 answer

How do I manually initiate the 404 handler in Slim 3?

We already know how to add a custom 404 notFoundHandler in Slim 3: $container['notFoundHandler'] = function ($c) { return function ($request, $response) use ($c) { return $c->view->render($response, 'pages/404.html.twig') …
alexw
  • 8,468
  • 6
  • 54
  • 86
17
votes
2 answers

Response header is present in browser but not parsed by Angular $http response.headers()

In our Angular app, we need to parse response headers of some $http. In particular we need to parse some X-prefixed response headers, for example X-Total-Results: 35. Opening the Network tab of the browser dev tools and inspecting the resource…
klode
  • 10,821
  • 5
  • 34
  • 49
17
votes
3 answers

How do i check for a 302 response? WebRequest

Using WebRequest I want to know if I get a "302 Moved Temporarily" response instead of automatically get the new url.
user34537