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
3,644
questions
0
votes
0
answers
5
views
Normalize response body in spring boot
I do have some entity class (code without annotations for simplified example)
class User {
public String id;
public String name;
}
Now I want to output this via an API, but I want to structure ...
0
votes
0
answers
13
views
How to find specific information in HTTP Java response? [duplicate]
This may be a rookie problem, but I'm stuck and I have to submit this by tomorrow.
In short, I send basic GET request to the website and then read responce using BufferedReader
if (HttpURLConnection....
0
votes
1
answer
16
views
Does a lack of status code mean the request failed?
What does it mean when the Edge DevTools Network tab shows the URL in red and no status code?
For example:
The browser shows "Hmm... can't reach this page" - does this mean the request ...
-1
votes
0
answers
18
views
Content Type issue in http requests (still text/html when I change it to application/json)
I try to write a service in PHP and my code does not work.
This is my code
<?php
$data_array = array();
$data_file_contents = file_get_contents("../data/credentials.txt");
$...
0
votes
0
answers
13
views
Test Method with HttpServletResponse argument
I have a method in my SpringBoot app, in GenerateZipServiceImpl class:
@Override
public void generateZipFile(final Parameters parameters, final HttpServletResponse response){
...
.....
1
vote
0
answers
21
views
Is there a way to return user rating of a one book for that user?
I am working on a project, trying to create an AudioBook website. I am stuck on this part and i cant find answers on the internet.
The problem is when i get user, and list of favorite books, each book ...
-1
votes
0
answers
28
views
HttpResponse object. It returned None instead [duplicate]
How can i fix it?
ERROR MESSAGE
The view shopping_mall.views.add_comment didn't return an HttpResponse object. It returned None instead.
My Views.py
def add_comment(request, pk):
post = ...
0
votes
0
answers
10
views
how to prevent privilege escalation by changing HTTP response values?
i want to know how to mitigate privilege escalation by changing the response values,
for example in response body: isAdmin=false
change it to
isAdmin=true
and get the privilege
0
votes
0
answers
30
views
Adding headers to response in an angular application
Is there any way to add headers to the http response in an angular application if the calls are made to fetch details from local json files?
Version: 8 and above.
0
votes
3
answers
41
views
Sending a Post Request to register a new user to a Web API, but receiving 400 : BadRequest
Having issues with my code [ Throwing an Unhandled exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request) ] when trying to connect to WebApi
...
0
votes
0
answers
29
views
How to send a POST request with after create or update of a user (RAILS)
This is my first time working with Requests and i'm a little confused, any guidance would be greatly appreciated.
Task: after a user is created i would like to send that user's information (name, ...
0
votes
0
answers
5
views
netty-readtimeout and return customized response to front end
I have a question regarding configuration of timeouts on a netty TCP server.
Currently we have configured readTimeOut as 120s. Set the connect timout like this:
socketChannel.pipeline().addLast(new ...
0
votes
0
answers
14
views
What is the order of HTTP responses, data, and error, and are they guaranteed to be in that order?
I am debugging/testing the part of my app that sends an HTTP POST, with a file to upload, to a 3rd party server and need to be sure of the order of the info that server sends back.
Below is a very ...
0
votes
0
answers
26
views
XSS filter for an existing Java application
my Java coding experience is mediocre at best. And I am trying to find out if there's a way I can implement a (XSS) filter on an existing Java web application. I googled and found folks using the ...
0
votes
0
answers
19
views
How to configure limit of response size from Tomcat8 server
I am looking for how to configure or verify limits of response size a Tomcat 8 server can support. I have some GET apis which can return a very large response. I see whenever response is like 50MB or ...
1
vote
1
answer
45
views
Display only certain keys in json response
I'm building a simple API with express and sqlite. I want my GET request to only display certain keys in each JSON object that is displayed in response.
Below is my current code:
router.get('/cars', (...
-1
votes
2
answers
53
views
Uncaught errors by .catch clause in Promise for JSON HTTP request
I have this function that collects JSON data from an API endpoint:
export const getDataAPI = (token_id) => {
const url = `https://api.url.com/tokens/` + token_id;
const options = {method: '...
0
votes
1
answer
41
views
Spring framework validate response data
I have custom simple endpoint that returns some object (record in my case). I would like to validate correctness of returned output data (i.e., output DTO does have all fields set to non null values ...
1
vote
0
answers
20
views
MinIO HTTPResponse | Decode into Dataframe or Excel
Goal: create either a Dataframe in memory or store file locally.
Struggling to decode Excel files; I can decode all other file types.
Code:
from MinioConn import MinioConn
from io import StringIO
...
0
votes
0
answers
49
views
Intercepting requested file path & Open file from different source in new tab
I have 4.7.2 application where on anchor tag we have file link like 'www.abc.com/a.txt'. If I click it file is opening in new tab.
But now expected result is - When user hit that link, I want to ...
0
votes
1
answer
34
views
Return Content From HttpResponseMessage and Map to POCO
I am trying to consume my api from another api, so I am using an HttpClient. My code Looks as follows:
public async Task<List<TeamName>> GetIpAddressDetails()
{
...
1
vote
0
answers
32
views
Is It possible to close the rest assured connection once the response generated using java
I am using below code for passing JSON request to an API service.
It is working fine and getting request and response properly. Due to some server issues or network connection error , some times the ...
0
votes
0
answers
19
views
How to customize response using Grape API
I am working in Grape API for a project and I have the below scenario. I have 2 tables from where I need to fetch the response. Initial requirement was, I have an entity called "job" where ...
0
votes
1
answer
77
views
How to read data from a Response object with cakephp 4
I need to read some data from a http URL with contains this data:
{"result":[{"reg":408,"val":670,"mod":5}]}
I've done this in my Controller:
public function ...
0
votes
0
answers
15
views
cannot find images in react response
I am trying to return multiple images in django to react. But I am unable to retrieve the images in react.
My httpresponse is dictionary in this format: {id1:[image1,image2], id2:[image1,image2}
but I ...
0
votes
1
answer
308
views
How to set Content-Length Header in ASP.net 6 Core to prevent Transfer-Encoding: chunked
I'm trying to create a middleware using .net 6 CORE, but I can't figure out how to set the content-length header to prevent the request being returned with the "Transfer-Encoding: chunked" ...
0
votes
1
answer
28
views
React dropdown not being populated with values from Supabase response
I am attempting to show a dropdown with a list of books in React using Semantic UI. The list of books is fetched from a Supabase table. The response seems to be coming through correctly however the ...
0
votes
1
answer
163
views
How to access Content-Disposition header in HttpClient response
I want to download a file from a server and save it with the filename suggested by the server (using Content-Disposition header).
I am using HttpClient to download the file.
The problem is that I ...
0
votes
0
answers
16
views
404 Not Found using HttpClient ASP.NET WebApi [duplicate]
i'm modifyng an application that is made in asp.net 4.8, this application has to connect to a webapi, so i'm using a nuget packaget "system.net.http". Everything was working fine, but at ...
-1
votes
2
answers
49
views
Node.js is giving different HTTP responses with different timeouts
I'm using Node.js for backend (I'm just testing it with localhost), and I noticed that with this code...
response.writeHead(200, { 'Content-Type': 'text/html' });
fs.readFile('index.html', (_err, data)...
0
votes
1
answer
52
views
'HTTPResponse' object is not callable
Im trying to open a file using python,for storing the article extracted from url.
import urllib.request
from bs4 import BeautifulSoup
url = "http://www.thedrum.com/news/2015/07/29/mankind-...
0
votes
0
answers
27
views
Reading simple response from Nodemcu via HTTP request
Please help me. I have simple NodeMcu webserver that has a /STATUS capability like this:
curl 192.168.0.200:8080/STATUS
response> Doors are open.
I am trying to read this via HTML request like this:...
0
votes
0
answers
122
views
Flutter - Getx issue with rest API requests
I have a problem with my project it doesn't happen a lot but it's very annoying, When a user call request for example (x) it could happen 1 time out of 10 and I don't know why this could happen and I ...
0
votes
1
answer
92
views
Can HttpResponseMessage.Content be null?
Given the expression:
responseBodyJson = await responseMsg.Content.ReadAsStringAsync();
Knowing that responseMsg is an HttpResponseMessage object and is not null, can Content (HttpContent object) be ...
1
vote
0
answers
63
views
Python SimpleHTTPServer : Desired Response Code generator
I have written a python code to generate desired response code for curl request
from email import message
from http.server import HTTPServer, BaseHTTPRequestHandler
import sys
server_ip = '0.0.0.0'
...
0
votes
1
answer
191
views
Trouble getting the HTTP response's body on a POST request in Angular
I am making a Registration form on angular 13, but when i receive the response from the API the response I get is always treated as an error and not as the actual response.
When everything on the ...
0
votes
0
answers
27
views
Exception error message not display in springboot project
i try to display simple error massage for the unavailable resource of my service model by extending my class with RuntimeException but didn't display
TodoService Implementation
@Override
public String ...
1
vote
1
answer
32
views
How to send two response for a single post request in Django Rest Framework?
I am processing a video in backend but it's taking some time so I am looking for a way by which I can send the process time first and after it's completion I can send the video url.
I tried using ...
0
votes
1
answer
121
views
How to get ClientResponse body as DataBuffer in Spring 5.3 WebFlux?
Before the deprecation of WebClient.exchange method I used to get ClientResponse body as Flux<DataBuffer> and manipulated it.
In Spring 5.3 the exchange() method is deprecated and I would like ...
0
votes
0
answers
23
views
How to deserializer two Models in django?
enter image description herei'm sending two serializer models to api.py file... it is sending successfully but how to de-serializer both models in api.py
views.py
from django.http import HttpResponse, ...
0
votes
2
answers
64
views
How to read the pdf content from response and write it to another new pdf file
%PDF-1.4
%����
1 0 obj
<<
/Type /Catalog
/Pages 9 0 R
/Outlines 8 0 R
/Names 6 0 R
i am trying to read above pdf content response from rest end point in java class and trying to write it to ...
0
votes
0
answers
175
views
Error 500 InternalServerError when use httprequest call API (python flask) with long time response
I build a service to call API from Python flask. This is my Service
public string CheckStatus(string json)
{
Utils log = new Utils();
string ResponseString = "";
...
0
votes
0
answers
28
views
Error retrieving Youtube comments using youtube.commentThreads().list() - Python
I am trying to retrieve comments from multiple videos and if the video have comments restricted, it throws me error on response. How can I handle this?
Example for the video with comment session ...
0
votes
0
answers
79
views
Print HTTP protocol version of given url
I'm building a webapp using Vue CLI to analyze http responses. I'm using axios to make get requests and a chrome extension which allows to send cross-domain requests.
My goal is to print HTTP protocol ...
0
votes
0
answers
27
views
In Chrome, files cannot be downloaded if previous pop up window is not closed
In .aspx file:
<a href='#' onclick='download(\"" + fileID + "\");return false;'>Download</a>
In .aspx.vb file:
function downloadFile(inFileID) {
window.open('../...
0
votes
1
answer
128
views
Decode zip/base64 file as a PDF file in response in Python (Django), why my PDF is blank?
I have zip/base64 data string. First, I tried to use base64 decode it. Then used zipfile in Python to unzip this file.
Then I put contents in response as a PDF file. I can see that the PDF I ...
-1
votes
1
answer
65
views
Retrieving http response headers information from any website
I'm using Vue CLI and axios.
I have a searchbar where the user can input (potentially) any website and read info about the HTTP request and response.
Some of the information I need to get are: HTTP ...
1
vote
2
answers
60
views
Why is my catch block being called when try is already handling the response?
I am aware that it is related to; setting the header a second time doesn't work, but my app is crashing after sending the first response without even sending another request.
When the app crashes the ...
0
votes
0
answers
26
views
requests.request.text returns encoded symbols
import requests
import json
url = "https://node1.web3api.com/"
payload = json.dumps({
"jsonrpc": "2.0",
"id": 2,
"method": "...
0
votes
0
answers
115
views
import java.net.http.HttpRequest, import java.net.http.HttpResponse, and import java.net.http.HttpClient not working
I'm making an app in Android Studio using Java and I want to access an API url, so I need HttpRequest, HttpResponse, and HttpClient. However, none of them are importing. Here's a picture of what the ...