Questions tagged [request-headers]
659 questions
184
votes
4 answers
How to get access to HTTP header information in Spring MVC REST controller?
I am new to web programming in general, especially in Java, so I just learned what a header and body is.
I'm writing RESTful services using Spring MVC. I am able to create simple services with the @RequestMapping in my controllers. I need help…

Horse Voice
- 8,138
- 15
- 69
- 120
93
votes
3 answers
How to set the content-type of request header when using Fetch APi
I am using npm 'isomorphic-fetch' to send requests. The problem I am experiencing is I am unable to set the content-type of the request header.
I set a content type of application/json , however the request header are being set to text/plain.
import…

user1526912
- 15,818
- 14
- 57
- 92
87
votes
2 answers
How to read TLS certificate sent by a client on the server side?
I am trying to call a service with mutual TLS using the Curl command.
Curl command used:
curl -k -vvvv \
--request POST \
--header "Content-Type: application/json" \
--cert client.pem:password \
--key key.pem \
…

sunsin1985
- 2,437
- 5
- 22
- 27
66
votes
5 answers
REST API - Use the "Accept: application/json" HTTP Header
When I make a request, I get a response in XML, but what I need is JSON. In the doc it is stated in order to get a JSON in return: Use the Accept: application/json HTTP Header.
Where do I find the HTTP Header to put Accept: application/json…

obrob
- 843
- 1
- 8
- 20
50
votes
2 answers
Modify request headers per request C# HttpClient PCL
I'm currently using the System.Net.Http.HttpClient for cross platform support.
I read that it is not a good practice to instantiate a HttpClient object for each request and that you should reuse it whenever possible.
Now I have a problem while…

coalmee
- 1,334
- 2
- 16
- 27
35
votes
9 answers
How to add HTTP headers in request globally for iOS in swift
func webView(webView: WKWebView!, decidePolicyForNavigationAction navigationAction: WKNavigationAction!, decisionHandler: ((WKNavigationActionPolicy) -> Void)!) {
var request = NSMutableURLRequest(URL: navigationAction.request.URL)
…

sandip
- 419
- 1
- 6
- 13
29
votes
2 answers
JS/jQuery get HTTPRequest request headers?
Using getAllResponseHeaders in the xhr object, is possible to get all the response headers after an ajax call.
But I can't found a way to get the Request headers string, is that possible ?

Lwyrn
- 1,821
- 1
- 16
- 27
23
votes
14 answers
How to fix 431 Request Header Fields Too Large in React-Redux app
I'm working through a MERN sign up/login auth tutorial on youtube that uses Redux. When attempting to POST a test user to the server in Postman, I receive the 431 header request is too large error response.
I've read in some places that clearing the…

Brent Abruzese
- 231
- 1
- 2
- 6
19
votes
4 answers
What is 'xmlhttp.setRequestHeader();' and in which situations is it used?
I stumbled on this command while learning AJAX. The guy who made the tutorial didn't explain this command, what do the parameters inside the command mean and what is it used for... Below is the code I used it in: