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
2,887 questions
0
votes
1answer
20 views
How to return a json in get_queryset()?
I want to return a error message in JSON format from a get_queryset() if error occurs. Does anyone knows hot to do it?
def get_queryset(self):
try:
#some code that returns a ...
0
votes
0answers
9 views
How to Select a file and send the response to API using Angular 6?
This is the basic js fiddle link, I am getting the file Properties but unable to send to server,while Sending it's taking c:/fakepath/filename. Instead I need the file properties.
Can anyone help me ...
0
votes
0answers
32 views
Getting JSON response data from server
I am trying to get the response error from a server in human readable format. I know there's an error, I just don't know how to parse the JSON. I am getting error The data couldn’t be read because it ...
1
vote
0answers
19 views
Pass Response (File) From Django to JavaScript
I am trying to achieve the following:
Create a file in Django/Python (for instance a Word Document with the python-docx module)
Pass the response (the complete file) to JavaScript, so I can do other ...
0
votes
0answers
9 views
Jax-rs Cache control header in response does not work
I am trying to cache the response of rest service but at every subsequent request request is sent to server. I am not sure what is I am missing in the code. I am using JAX-RS for setting the cache ...
-1
votes
0answers
13 views
Handle multiple URLS in Access-Control-Allow-Origin: * (cors.allowOrigin) in Web.xml
I am trying to restrict the Access-Control-Allow-Origin to specific domains and I am stuck at
<init-param>
<param-name>cors.allowOrigin</param-name>
<param-value>*<...
0
votes
2answers
29 views
Http response and request in java related framework like spring, spring boot
I want to stored http request in databases and will generated response to it when required.
Is it possible to stored the http request in db and generate response to it after 1 day or more in spring ...
0
votes
0answers
8 views
Parsing Json through HTTP Get Request
I'm getting below reponse with this Http get request = xyz/api/v2/comments
Response:
{
"list": [
{
"comment": {
"id": "12",
"entity_id": "...
2
votes
1answer
42 views
How do I set a HTTP response header in middleware which is not discarded when a MVC Core controller throws an exception?
The following program creates a simple ASP.NET MVC Core 2.2.0 site with two routes:
/success - returns the string "Success Response".
/failure - throws an exception, causing a 500 to be returned
...
0
votes
1answer
29 views
Escape statements on basicCard response formatted text not parsed
I have a php script on my website and this action is linked as a webhook to it. So once the data is submitted to the server, this is the response I send in json.
`{"payload":
{"google":
{"...
-1
votes
0answers
14 views
+50
How to get default html response body (Inside Exception Filter) (web api c#)
I need code to get default html response body inside generic exception filter so that i can send the same exception as email body just like Elmah logging sends exception via email. Please follow the ...
0
votes
0answers
69 views
Get html from response text
I am trying to scrape a website that uses AJAX with Scrapy, I am sending a Request and I sometimes don't fully understand the result of the execution. This is my code now:
class BaseSpider(scrapy....
0
votes
0answers
20 views
“Cloning” a HttpResponseMessage to a HttpResponse
For a project I need to build a "proxy" for an third party API because parts of the API should be blocked for an external party. Now I can use HttpClient to retrieve the information from the API but I ...
0
votes
0answers
10 views
What should be status code for inactive item?
What should be status code for api which try to access inactive resource?
Is it 404(Because we developer know that we have item stored in database as inactive but for users item is not available) or
...
1
vote
2answers
71 views
Angular 7 Why Convert body to JSON string and to Object
Why do I have to convert event.body to JSON string and parse back to object?
this.excelFileService.upload(this.currentFileUpload).subscribe(event => {
if (event.type === HttpEventType....
0
votes
0answers
5 views
macOS Paw - Parse response cookies for request header
How do I parse a response cookie and sent back a specific value into a request header?
I'm making a request: it's sending back a token in a session cookie (token=longstrong). I need to grab that ...
1
vote
0answers
50 views
DataSnap Server - Send custom HTTP response headers
I have built a standalone (Delphi EXE) DataSnap server using TDSServer, TDSServerClass etc. I want to be able to send custom HTTP headers in the response from my server methods. I can see I can use ...
1
vote
2answers
33 views
View didn't return an HttpResponse object. It returned None instaed
I'm using Django 1.11 and I'm trying to improve an existing code which let to export data to an Excel file. There are 2 cases :
File contains less than 70.000 rows. In this way, user can directly ...
1
vote
2answers
26 views
http request post username and password wih header to get auth/key in R
Can I get recommendation to learn http request post username and password with header to get auth/key in R?. Thanks
0
votes
0answers
25 views
Redirect to action after end response don't work vb.net mvc 5
Hello i have nomes issues when i export data to xls file through a response
the response works fine i got my xls file but the page doesn't redirect to Index page
here is my Action code
Function ...
0
votes
1answer
17 views
Why does innerHTML does not work after servlet is posting a response?
I want the response from the servlet to be captured in the jsp page. I use javascript for this. Here is the code:
TestServlet.java:
package com.test;
import java.io.IOException;
import ...
0
votes
1answer
28 views
Finding result of POST in Http Response Message
I am building REST Client (c#) using windows form application in VS2017. I have been able to successfully GET and POST requests from the server using the HttpClient.PostAsJsonAsync() and ReadAsync() ...
0
votes
1answer
27 views
NestJS return a fie from GridFS
I am trying to return a file from GridFS using my Nest controller. As far as I can tell nest is not respecting my custom content-type header which i set to application/zip, as I am receiving a text ...
-5
votes
0answers
24 views
Angular HttpClient response status is unefined [duplicate]
I am trying to make http get request using angular like this:
this.http.get(GetDrivers + '?service_identifier=' + 'road_logistic' + '&page=' + '1', { }).subscribe((response:any) => {
...
0
votes
1answer
34 views
How to handle error responses from in any step of a completable future chain?
I've got a chain of completable futures, each of them making an API call, depending on the previous result. I am trying to understand how to process error responses in each chain. If any step gives me ...
0
votes
1answer
13 views
HTTP response code for request that is too complicated or difficult to compute
Say I have a server that calculates factorials:
> GET localhost:8080/factorial/10
200 3628800
In my analytics 99% of my users ask for factorials that are computationally cheap to calculate, but ...
0
votes
1answer
33 views
Error response body format from a request with specific “Accept” header
My HTTP/Rest API has a resource endpoint that can handle "application/json" and "text/csv" response body formats which are specified via the "Accept" header on the request.
In case of error, like an ...
0
votes
0answers
28 views
Cache control max age header in swagger.yaml
My swagger.yaml is working fine with the only issue being the cache-control header. I don't see it in the response. I have defined it as below. Could you please let me know what is wrong with it?
/{...
0
votes
0answers
15 views
Program not going into Response Listener at all
So I created an API for my Android App to communicate with my local database (using Wireless LAN). I used Java (for app) and PHP (database connection).
The API call works on the PHP side of things as ...
0
votes
0answers
20 views
How to remove private from Cache-Control through web.config or IIS settings
I tried many ways to remove private value from cache-control HTTP Response Header, I made it possible through global.asax file but unfortunately I was asked to make this possible either through web....
2
votes
0answers
62 views
Best practice for handling Laravel response errors with Axios
I have been stuck deciding which method is the best practice for error handling. This involves sending requests from Axios client side, to Laravel server side. I've got two different methods for how I ...
0
votes
1answer
33 views
Returning an already compressed response to client
I'm trying to "forward" a compressed response received from an API call to our client. The call chain goes: client -> backend -> API-call to other backend, and I'd like to have the response to remain ...
0
votes
1answer
49 views
Full Screen mode not working while loading the web page in a new window
I used the following code segment to move from A.aspx web page to B.aspx web page and I need to load the B.aspx page in full screen mode in a separate window. I am able to load the content on a ...
0
votes
1answer
88 views
How to get interim response in Angular HTTP - ArrayBuffer
I'm having a Electron application internally I'm loading the Angular application. I'm downloading a byte array (i.e., ArrayBuffer) through an API call and passing those data to a method which I'm ...
3
votes
0answers
76 views
Why doesn't Response.TransmitFile return my file in my WCF service?
If you could explain me why TransmitFile ain't working, code is simple, I create excel file (.xlsx), save it on server and return file path (via CreateProjectsReport), and then I just want to take ...
0
votes
0answers
20 views
Trying to upload a file from javascript to WCF Web Service
I am trying to upload a file from ionic to a WCF web service on an external service.
I think I know TypeScript fairly well, but I am a newbie to file transfers in ASP.NET. I have tried a number of ...
0
votes
0answers
35 views
decompress responses with ning.http.client
I'm using com.ning.http.client (version number 1.8.3).
I didn't find any documentation on what the setCompressionEnabled(true) does beside setting the Accept-Encoding header in the http request to ...
0
votes
0answers
5 views
What is the right way to transform a batch-create response to create response
I'm pretty new to batch processing. We have internal APIs that returns a standard BatchCreateResult object which wraps a List. Each create result has its own Http response code.
I am building an API ...
-1
votes
1answer
19 views
api POST Auth always returns 200 but has a 401 error
Let me first say that I have researched extensively and have no clue whats happening to why when I login with the "wrong" password or user the network Auth status says 200 but the console reports the ...
0
votes
2answers
51 views
Laravel slow image respond
In one of my pages, i display multiple images. I get the images through a route, which is connected to a controller method. Like so:
In view:
(inside foreach)
<img width="100" src="viewBook/get/.....
0
votes
1answer
36 views
Make httputil.ReverseProxy Foward Response Stream Correctly
I have reverse proxies in my main web-server that are dedicated to a certain micro-service and handle forward requests to their appropriate micro-services.
func newTrimPrefixReverseProxy(target *url....
-1
votes
2answers
31 views
Symfony HTTP response doesn't contain the specified body
I'm using the following javascript code to execute an HTTP request:
function ready(path) {
fetch(path, {method : 'put'})
.then(function (response) {
console.log(response);
...
-1
votes
1answer
33 views
[SOLVED]Bad Request 400 POST WCF Service TEXT/XML (C#)
(SOLUTION)
configure my project in visual studio and add service reference, this solved everything, I create all the authomatic references
THX ALL
I need help, I have the following code,
Services ...
-1
votes
1answer
22 views
Symfony: fetch with put request on route results in RuntimeException
I'm trying to call a service method through a button click with the following code:
Twig HTML:
<input type="button" value="Ready Up" onclick="ready('{{ path('ready', {'playerName' : name}) }}')"...
0
votes
0answers
16 views
I need to convert CSV into ZIP and then send it as HttpResponse to ajax
I am struggling in converting csv to zip. I have to create CSV from MySQL stored procedure result and then compress it in the zip. After zip has been made then I have to send that zip as Httpresponse ...
0
votes
1answer
44 views
IE - Angular's json response contains unicode character that removed additional characters. Invalid JSON
I have a http response that has a name that contains a unicode character (ex. Müller).
In IE11, I'm getting an error that says "Invalid Character" because it seems that in IE11 the whole http response ...
0
votes
1answer
37 views
How to save an image from a base64 string passed through ajax request using c# webmethod
I want to upload an image when i select it from an input file control.
How can i upload it, with async process and refresh the link in the page when finish the upload.
I have already created the ajax ...
0
votes
1answer
45 views
How to generate HTTP Request response data in JSON format?
How to generate HTTP Request response data in JSON format? I am getting the response data in the HTML format.
In the HTTP Header Manager, I am sending the Content-Type = application/json. In the HTTP ...
0
votes
0answers
17 views
In c# , How to get stream response before asking for the getresponse through httpWebRequest
In c# , I am writing stream data through httpWebRequest and before I write all the stream it responds with 200 success. I want to access that status and I am not getting any code to access it. If i ...
1
vote
1answer
48 views
Unable to download file on Client Location C# Asp.NET
I am trying to download a zip file and at the same extracting and running unzipped content however when code is executed, zip file is extracting at server location and also content is running there. ...