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

IIS web response connection forcibly closed issue

I have client desktop app and web service deployed on external server (IIS). Communication between them is based on HttpWebRequest and HttpWebResponse. This code was working fine on IIS 8.0 and after upgrading it to IIS 8.5 sending response back to…
RadMi
  • 11
  • 1
1
vote
0 answers

Create HTTP GET in C return 301 redirect using IP address

I want to send a GET request to a page and retrieve it to use later to a crawler I have implemented my own D.N.S. resolver (like DIG command in LINUX) and I want to use the ip address to get the http page I have the following code typedef…
joesid
  • 671
  • 1
  • 10
  • 21
1
vote
2 answers

Is there a way to use a universal base response containing value, error and warning fields?

So, according to official documentation sample, responses from OneNote might have the following structure: { value:{the content we requested}, error:{error if exists with warnings inside if exist}, @api.diagnostics:{warnings if exist} } But,…
1
vote
1 answer

Python Django - Access Response Headers In View

I am working on a web application which works with entities that all have their unique IDs. I have a submit form for users to create these entities and this form is in several steps (i.e. view 1 redirects to view 2, etc... until the end of the…
RobinW2
  • 99
  • 1
  • 7
1
vote
0 answers

Add Custom Response Header to a SINGLE file in IIS

I understand you can edit the webconfig file to add a custom header but that adds to all the pages from the server. I will like to add a custom response header to a single file in IIS.
1
vote
1 answer

how to add a new header to context.response in asp.net

I'm very new to asp.net. I am building on an existing project where the username and password from the js file are encrypted and an ajax function call is made to the .aspx.cs file. This ashx.cs file decrypts them and and then inserts them into the…
user3387677
  • 37
  • 2
  • 11
1
vote
2 answers

Unit testing test for Ok Result

I have the following (simplified) controller: public async Task Profile(UpdateProfileModelAllowNulls modelNullable) { ServiceResult result = await _profileService.UpdateProfile(1); return…
Alex
  • 3,730
  • 9
  • 43
  • 94
1
vote
1 answer

Web API 2, return string as a file

I have a Web API 2 POST endpoint which takes a parameter, queries the database and returns an xml string as the response. public async Task Post(long groupId) { People people = await _someService.GetPeople(groupId); …
Bryan
  • 5,065
  • 10
  • 51
  • 68
1
vote
1 answer

how to build com.netflix.client.http.httpresponse object

I am writing unit test cases, using mocking concept, I am mocking RestClient class original code: final HttpResponse response = restClient.executeWithLoadBalancer(request); Test class mock code in Spock: restClient.executeWithLoadBalancer(_ as…
Sat
  • 3,520
  • 9
  • 39
  • 66
1
vote
1 answer

How to read http response of multi-part stream in c#

I need to receive response from a http server using c#.The response is a multi-part stream; the header would contain Content-Type: multipart/x-mixed-replace; boundary=userdata The body of response would be similar to below: --userdata Content-type:…
Manish Jain
  • 1,197
  • 1
  • 11
  • 32
1
vote
1 answer

How to name my custom HTTP codes?

We're building a backend with a number of APIs. What should be the ideal range of HTTP codes that I should be using? I've gone through https://en.wikipedia.org/wiki/List_of_HTTP_status_codes and they give a list such as: 1xx Informational 2xx…
Karan Shah
  • 1,304
  • 11
  • 15
1
vote
0 answers

Express responds with net::ERR_EMPTY_RESPONSE when returning res.status(200).json({})

Following is my server side code : processRequest.process(selectedDiaryVersion, modality, operation) .then(function(uniqueName){ console.log("before sending success response in /code"); console.log("name…
Udarr
  • 13
  • 5
1
vote
1 answer

Does eliminating "X-Powered-By" header automatically eliminate "Server" header from HTTP response

I am using helmet NPM module to get rid of X-Powered-Bybut not sure about Server header. I have read Remove headers for security but not sure how to get rid of Server header using helmet module.
user4408375
1
vote
0 answers

C# Response.ContentType Creating multiple tabs in Excel

I'm generating an Excel report in C# and need to add a second tab to the Excel file that will contain reference data. How do I achieve this without using ClosedXML ? Response.AddHeader("content-disposition", "attachment; filename=" +…
CodeSharp
  • 15
  • 4
1
vote
1 answer

Google Safe Browsing API v4 - Empty response

Despite that I check a malicious URL (http://fileserver03.com), empty response returns from Google Safe Browsing API v4. Here is the code I have tried: String postURL = https://safebrowsing.googleapis.com/v4/threatMatches:find?key=API_KEY String…
talha06
  • 6,206
  • 21
  • 92
  • 147