Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set content-type (with custom charset) on request #243

Open
dnno opened this issue Jul 22, 2024 · 0 comments
Open

Unable to set content-type (with custom charset) on request #243

dnno opened this issue Jul 22, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dnno
Copy link

dnno commented Jul 22, 2024

Describe the bug
I'm trying to scrape a webpage that is delivered in ISO-8859-1. SkrapeIt currently defaults to charset UTF-8 (as it should). I'm trying to override the content-type to test/html;charset=ISO-8859-1 but I'm confronted with a ktor error Header(s) [Content-Type] are controlled by the engine and cannot be set explicitly. I understand that this is not a SkrapeIt error, but are there any suggestions how to work around this?

Code Sample

request {
   url = "<example.com>"
   body {
      contentType = "text/html;charset=ISO-8859-1"
   }
}

Expected behavior
The webpage is read with the correct encoding.

@dnno dnno added the bug Something isn't working label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants