Most voted "http-headers" questions
73 questions
Sort by count of
-
87
votes8
answers75484
viewsError - "Cannot Modify header information - headers already sent"
I have the following code using the function header() of PHP: header("location: painel.php?spv=nav/regMove"); exit; and when it is triggered reports the following error: Cannot Modify header…
-
25
votes1
answer18896
viewsWhat is Connection Keep-Alive?
When I check the headers I’m sending on a php page, which is installed locally, I always see this Connection: Keep-Alive. Example: var_dump(getallheaders()); Exit: array (size=7) 'Host' => string…
-
20
votes2
answers907
viewsWhat is HTTP Response splitting?
Reading about HTTP headers I ended up coming across a function filter that removed both invalid characters from the header field value (header field), how many multiple characters CRLF. This second…
-
19
votes3
answers4009
viewsWhy is it important to remove X-Powered-by from response headers? How to remove?
Why it is important to remove the X-Powered-By of the response headers? This prevents some kind of attack, or avoids "insider information" to the attacker? Example: X-Powered-By:…
-
17
votes1
answer1019
viewsHow to send Tokens from server to client?
I am creating an API, I use authentication via Token (JWT), I want this token to be valid for, for example, 10 minutes, and, with each request, return a new Token, so the user will have access while…
-
16
votes2
answers240
viewsHow do I serve a site in multiple languages in Apache?
I’m developing a website that needs to be available in 3 languages (only static content, to be served by Apache). I would like to make use of the language detection features so that the user already…
-
15
votes2
answers6768
viewsWhat is, and how it works, a Etag
I have been making socket requests to my Apache server in order to create a prototype of Framework, and for each different file that was accessed, returned a Etag in the header. What good is a Etag?…
-
15
votes2
answers189
viewsAre HTTP headers case sensitive or case insensitive?
Two headers with the same name but one in upper case and the other in lower case, by default, are considered the same? What HTTP does, unite them, ignore some or send both? An application that waits…
-
13
votes1
answer13920
viewsHow does the "Referrer Policy" header work?
I was doing some tests using Opera browser (same engine/engine as Chrome) and HTTP request sends this: Referrer Policy: no-referrer-when-downgrade For example in http://localhost get this: Request…
-
12
votes1
answer191
viewsIs the appropriate type to serve Javascript "text/javascript" or "application/x-javascript" or "application/javascript"?
When analyzing the source code of several pages, it can be seen that the Javascript headers vary with regard to the mime (English) indicated, but the doubt remains about which we should effectively…
-
11
votes1
answer30199
viewsWhat is the difference between x-www-form-urlencoded and form-data?
Is there any relevant difference between content-type x-www-form-urlencoded and form-data? I always have doubts when I should use between one or the other, because I don’t know if there is any…
-
8
votes2
answers1098
viewsAngular POST with custom header and CORS
I need to perform a POST request using angular (http.post) and I need to pass to my API (.NET) in my header the access credentials (I’m using basic Authentication). Authorization:Basic…
-
7
votes1
answer751
viewsIs it possible to add Origin in the Header of a redirect according to the HTTP protocol?
I am implementing an application where I need to perform a redirect from one server to another and am encountering problems. While performing a redirect, receive the following error message:…
-
6
votes1
answer597
viewsHow to understand the required requests in Curl?
Yesterday I opened a question I was obliged to delete it, because I could not ask correctly. This question I will try to explain it in parts, come on. 1 - I monitored Twitter, following a person, I…
-
6
votes1
answer96
viewsWhat is the purpose of "X" at the beginning of some header names?
There are specific HTTP headers that have the purpose of passing some information. As for example the Content-Type that informs the mime of the content you want to receive or send. We also have the…
-
5
votes1
answer888
viewsPHP (setcookie) vs header (header )
I see some frameworks, CMS and the like, writing cookies directly in PHP with setcookie and others stock to send us headers at the end of the run. I wanted to know how to create a pattern for the…
-
5
votes1
answer331
viewsAndroid and HTTP request field X-auth-token
I am trying to send a token, through an Android application in the 'X-auth-token' header field. This request is sent to a PHP server, where I use Codeigniter. Android HttpClient httpClient = new…
-
5
votes2
answers1316
viewsMonitor PHP script processing
Does anyone know a way to monitor PHP code processing and present to the client? I’m designing a converter layout which takes data files in a given format and converts to another format. Basically,…
-
5
votes3
answers949
viewsWhy does the User-Agent header always return "Mozilla /5.0" independent of the browser?
I know that in PHP we can access a header called User-Agent and thus discover information about the operating system and browser used by the client. The only thing I don’t understand is that…
-
5
votes1
answer577
viewsHow to implement Feature Policy Header by htaccess?
For which I understood, this response header controls access to the content of the application, and in conjunction with other headers such as the Referrer Policy approached in this question,…
-
4
votes1
answer1358
viewsAllow to display my wordpress site in an iframe on another site
Hello, I have a wordpress site that would like to show one of the pages in an iframe on another site, is it possible to do this? At the moment doing the iframe on another page seems to me the…
-
2
votes1
answer164
viewsIn an Ajax XHR request, in HTTP_ACCEPT what is the meaning of q=0.01?
I have a communication via Ajax (xhr), and in my HEADER the value of HTTP_ACCEPT is application/json, text/javascript, */*; q=0.01. I understand all the above values, I would like to find something…
-
2
votes0
answers51
viewsWhat’s the "P3P" heading for?
I recently found a header with the name P3P, I’ve never seen this before and I don’t know what the real impact is on using this header. I found some information, like this huge documentation, some…
-
2
votes2
answers102
viewsHow to convert the If-Modified-Since header to a date (and vice versa)?
The header If-Modified-Since displays the following return format: Wed, 21 Oct 2015 07:28:00 GMT I need to compare this date that comes in this header item with the creation date of a file on my…
-
2
votes4
answers184
viewsHow to set a GET request header in Golang
I’m trying to make Golang my first mid-high level language, but I’m having some problems. I can’t set a header for an external GET request at all, I searched the documentation, forums and the only…
-
1
votes1
answer2343
viewsReceiving JSON with PHP via $http.post()
I want read a JSON in PHP received from a function $http.post() from Angularjs, I’ve tried using json_decode() and set up the header (both in PHP and Angular) but it didn’t work. PHP accuses it to…
-
1
votes0
answers128
viewsHost Header Attack
Good evening, I wonder why Acunetix gives a red alert when I scan my site: "Host header Attack" And not only my no, many websites accuse of this and I did not find talking a lot about it on the net…
-
1
votes1
answer92
viewsRemove http header in socket C
I made a socket in C. This program is command-line operated and compiled over Linux. It takes as parameter a complete URI and a file name, and then connects to the server, retrieves the page and…
-
1
votes2
answers116
viewsWhat is the appropriate http code to respond to the contents of an image?
Well, the question is quite straightforward. I want to use PHP to answer the content of an image. However, I would like to know if the http status type will have any impact on the client (for…
-
1
votes0
answers38
viewsHTTP header authentication error
I’m trying to set up a Zopim Reseller API, only I’m facing a problem: Key API authentication and Secret API. I have the following Javascript code: <link…
-
1
votes0
answers93
viewsAndroid - Httpurlconnection cookie
I have a native login screen on android, which the user enters login and password, and does a check via Httpurlconnection if the data is correct, if yes then it saves the cookie, and returns that…
-
1
votes1
answer699
viewsIs it possible to manipulate http request header?
This is a requisition http, it is possible to perform header manipulation of the request? Or is it only possible to make such a manipulation in the response? If possible, in which languages with…
-
1
votes0
answers117
viewsSlim Framework status code 404
When making requests I get the following error. Xmlhttprequest cannot load http://www.domain.com.br/api. Response for preflight has invalid HTTP status code 404 Man .htaccess is like this:…
php htaccess http-request http-headers slimasked 8 years, 4 months ago willian rodrigues andrade 85 -
1
votes0
answers121
viewsWhy even set the headers the page cache is not updated?
Use the Laravel 3 in a certain system that we develop here in the company. I need that every time the application version changes, the cache of all users be updated. The programmers here have…
-
1
votes1
answer388
viewsBest practice for sending authorization via HTTP header
I am developing a Rest api, I need to pass some data on all the requests that are basically the required authorization. The data are: Token, unit and an id. What better way to pass this via header.…
-
1
votes0
answers29
viewsWeb service data format identification
Good night! I am implemented a service in one system for other systems to consume. This system consumes data in XML and JSON formats. I want to know if there is any way to identify when the user…
-
1
votes0
answers25
viewsWhat is the difference between HPACK and QPACK?
Many changes came with HTTP 3, one of which is the use of QPACK instead of HPACK (introduced in HTTP 2) for compression of headers What’s the difference between them?
-
1
votes0
answers511
viewsReturn value in the Header of an HTTP call (POST) in the API
I’m using Postman to make the call at the API. That returns me this result in the body: that comes from this abstract class: public abstract class ResponseBase { public long SessionId { get; set; }…
-
1
votes1
answer1950
viewsSend headers in HTTP Request with Curl in PHP
Hello, I made a function to make Curl calls to an API and I’m able to make the calls but I’m not able to send headers. Function: function curlRequest($endpoint, $verb, $headers, $params = null) {…
-
1
votes1
answer3615
viewsCORS error when requesting using Httpclient at Angular
I am trying to perform an HTTP request using "Httpclient" from Angular 4, and I get the following error: Request header field Access-Control-Allow-Origin is not allowed by…
-
1
votes0
answers153
viewsHow do I get my token in the header?
Guys, I’m 'stuck' in this part of the code, I’m generating my token pro browser but I can’t access it to save in my localStorage. I can’t, in any way access my header this way, every time returns…
-
1
votes0
answers92
viewsHow to generate a nonce with mod unique_id for Content Security Police?
I’m trying to generate a nonce to the CSP, I have already enabled the mod unique_id of the Apache, and .htaccess is already generating correctly. Header set Content-Security-Policy-Report-Only…
-
1
votes1
answer377
viewsSend jwt in header by GET
Hello I would like to know how I could send a jwt in my header to consume in my API, a route get to catch users ( need auth ) my api to catch users: app.route('/users') .all(app.auth.authenticate())…
-
0
votes1
answer1035
viewsHow to download a file and open it at the end of the download?
I have an Android application, I’m trying to download a .apk and then open it when the download is finished, follow the code used: /** * baixando arquivo na background thread * */ @Override…
-
0
votes2
answers237
viewsAftnetworking with Token to download image
I’m testing Aftnetworking to download images from a backend, but I’m having errors downloading images. I tested several implementations, with this implementation presents error of content not…
-
0
votes1
answer27
viewsHow to differentiate a url typed by the user and the one invoked by the html code
I need to compile an analytical report for a client about which Urls each network user accessed. However, the reports I’ve been observing show thousands of records that don’t serve that purpose.…
-
0
votes1
answer441
viewsCall a wordpress page in PHP page
I tried to use the following command to go to a wordpress page, but it did not work. echo '<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=$buscahttp>'; <script>location.href =…
-
0
votes0
answers85
viewsThe underlying Connection was closed / Httpwebrequest
I use this request to get the return of a page, but my connection is rejected with this message The underlying connection was closed: A connection that was expected to be kept alive was closed by…
-
0
votes1
answer348
viewsHow to change http header using (). get and (). post()?
Very briefly I need to send a jwt token in the http header of the requests, as I can change the headers of jQuery requests $.post() and $.get()? Example of how I do using Curl by prompt: curl -H…
-
0
votes0
answers36
viewsLocation in php not working
Guys, I was watching a video lesson here very simple, prof put a code in php in html, I put exactly what it is because and it’s not working at all, I’ve tested in other browsers and tbm didn’t work,…