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
1
vote
1 answer

ajax response from return content with IHttpActionResult for non-OK response

Is there any way to show the custom message in ajax error? I have this at server side [HttpPost] public IHttpActionResult CrearProducto(EProducto Producto) { if (objBLProducto.ObtenerProductoRepetido(Producto, ConnectionStringStore).Count > 0) …
1
vote
2 answers

Returning single object and string from web api controller method

I am in a situation where i need to return the single object along with string .. I am very new to web api and just could not be able to figure it out how to return multiple parameters .. below is the code what i have tried so far .. public…
Glory Raj
  • 17,397
  • 27
  • 100
  • 203
1
vote
1 answer

Asynchronous streaming of large files using ASP.Net Framework 2.0

I am working on an ASP.NET framework 2.0 application. On a particular page I am providing a link to user. By clicking on this link a window opens with another aspx page. This page actually sends http request to a third-party url which points to a…
1
vote
1 answer

Angular JS HTTP Response header not working on Safari

I am stuck in a problem where I am posting an object, in response I should get some header from the HTTP response. The problem is this code is working fine in browsers like Chrome, Firefox, IE but it returns null in case of Safari (Windows). …
Ankit Singh
  • 121
  • 7
1
vote
1 answer

Check valid url before reporting 405 for detail view in Django REST framework

I have a ViewSet that looks like this: class BoardViewSet(viewsets.GenericViewSet, ...): @detail_route(methods=["post"]) def register(self, request, pk): board = self.get_object() ... I get the following results, when I make…
Lucretiel
  • 3,145
  • 1
  • 24
  • 52
1
vote
0 answers

OK response even with the wrong password?

I am trying to write a script that'll let me interact with my router without opening up the browser. I wrote the following script. from bs4 import BeautifulSoup import requests username = input("Enter username ") password = input("Enter Password…
Sahil
  • 1,387
  • 14
  • 41
1
vote
1 answer

Java outputstream, trigger file download before all data retrieved from db

Im trying to wrap my head around Java Out/Inputstreams, closing and flushing. I have a situation where I want to create a file using Apache POI with data from a server. I would like the file to start downloading as soon as I retrieve the first…
rogger2016
  • 821
  • 3
  • 11
  • 28
1
vote
1 answer

How to get the HTTP status of an API in spring boot when we hit it internally using Rest template

I want to get the object as well as the HTTP response of one api into another in Spring code. For that I am using a rest template and I am getting the desired Object from it successfully. But I want to fetch HTTP response also for the respective…
Amit Gujarathi
  • 1,090
  • 1
  • 12
  • 25
1
vote
2 answers

playframwork set response header globally

how can I set the respnose headers globally for my playframework project? I don't want to add the stuff for each REST method. response().setHeader("Access-Control-Allow-Origin", "*"); response().setHeader("Allow", "*"); …
Felix
  • 5,452
  • 12
  • 68
  • 163
1
vote
2 answers

HttpClient PostAsync returns 500 when getting token

I am trying to figure out what I can do (logging, things to check) before having to read server logs as I don't want to miss something stupid before requesting that. Here is my code: const string URL = "https://SomeURL/api/security/"; string…
Pittfall
  • 2,751
  • 6
  • 32
  • 61
1
vote
0 answers

Django view returning file + flash message

I am returning a pdf file to be downloaded. On success I'd like the success message to be flashed. I want the user to stay at the same page. Ajax wouldn't work as it is file download. but it seems that the flash messages work only with…
fanny
  • 1,373
  • 12
  • 25
1
vote
2 answers

Handling Retry Logic on HttpResponse 404 with Akka http

I am trying to implement a code which makes request to external REST endpoint and when that endpoint returns a 404, it should retry for finite times. The HttpRequest is something like val responseFuture = Http().singleRequest(HttpRequest(method =…
nik266
  • 13
  • 5
1
vote
1 answer

Django HTTP Response object for GAE Cron

I am doing this using Django / GAE / Python environment: cron: #run events every 12 hours and def events(request): # read all records # Do some processing on a few records return http.HTTPResponseGone('Some Records are modified'…
1
vote
3 answers

Sending .txt file to client c#

I'm struggling with the ability to take a file from the server and allow a user to download it. On my machine, I was just opening it but since it has gone to production this doesn't seem to be a working solution. public HttpResponseMessage…
Corey Whaley
  • 66
  • 3
  • 11
1
vote
1 answer

HttpResponse - how to set status code depends on PushStreamContent execution result

I write data to http response using PushStreamContent class. I need to retrieve an appropriate HTTP status code depends on result of onStreamAvailable delegate execution. Here is an example code: [HttpGet] public HttpResponseMessage Get(int id) { …
Dmitriy
  • 683
  • 2
  • 13
  • 26