Accept header never changes
See original GitHub issueBug Report
Prerequisites
- Can you reproduce the problem in a MWE?
- Are you running the latest version of AngleSharp?
- Did you check the FAQs to see if that helps you?
- Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g.,
AngleSharp.Css
for CSS support) - Did you perform a search in the issues?
For more information, see the CONTRIBUTING
guide.
Description
Accept header stays the same even if you set it manually when supplying a requester.
Steps to Reproduce
- Set a custom Accept header when creating a DefaultHttpRequester
- Open a url using the context
- Accept header always stays as “text/html,application/xhtml+xml,application/xml”
Expected behavior: Accept header should change to a desired value upon setting
Actual behavior: Accept header stays the same (“text/html,application/xhtml+xml,application/xml” by default)
Environment details: Windows 10, .NET 5, Console App
Possible Solution
Default Accept header is set when creating a DocumentRequest. Instead, it should be set when DefaultHttpRequester is created.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Is Accept header needed for a POST method which doesn't ...
I have an endpoint which supports POST method with content-type as json(only). But the POST request doesn't return any content in its response ......
Read more >Accept-Language - HTTP - MDN Web Docs
The Accept-Language request HTTP header indicates the natural language and ... Users rarely change it, and such changes are not recommended ...
Read more >Understanding The Vary Header
The rationale for this is that the things we typically use Vary for (mainly Accept-Encoding and Accept-Language ) do not change frequently ......
Read more >HTTP/1.1: Header Field Definitions
Accept headers can be used to indicate that the request is specifically limited to a small set of desired types, as in the...
Read more >Headers to prevent 304/If-modified-since/HEAD requests
Make sure you only use this when you are sure the file will never change. One scenario would be if you have a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is why you use
GetSubmission
. It contains all the info as the form request would have…Durectly calling the API is not possible because the rest of the form which is sent as json contains a token which should be sent back when you submit your password. Alright, I will try to do as you have described. Thank you very much for your help!