question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accept header never changes

See original GitHub issue

Bug 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

  1. Set a custom Accept header when creating a DefaultHttpRequester
  2. Open a url using the context
  3. 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:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
FlorianRapplcommented, Feb 11, 2021

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!

This is why you use GetSubmission. It contains all the info as the form request would have…

0reactions
aidilumarovcommented, Feb 11, 2021

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found