Skip to content

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

@dnno

Description

@dnno

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions