Error when creating acronym (HTTPMessageDecoder)

when i trying to create acronym
Display Options

"error": true,
"reason": "There is no configured `HTTPMessageDecoder` for content type: text/plain."

It give me this error
Although the user id is correct

build and run give

    [ INFO ] Migrating 'psql' database (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationConfig.swift:69)
[ INFO ] Migrations complete (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationConfig.swift:73)
Running default command: /Users/Mercury/Library/Developer/Xcode/DerivedData/tilm-fvubjgvnptnzsvbawelesfezgtzn/Build/Products/Debug/Run serve
Server starting on http://localhost:8080
[ ERROR ] VaporError.httpDecoder: There is no configured `HTTPMessageDecoder` for content type: text/plain. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift:64)
[ DEBUG ] Suggested fixes for VaporError.httpDecoder: Register an `HTTPMessageDecoder` using `ContentConfig`. Use one of the decoding methods that accepts a custom decoder. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift:20)
[ ERROR ] VaporError.httpDecoder: There is no configured `HTTPMessageDecoder` for content type: text/plain. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift:64)
[ DEBUG ] Suggested fixes for VaporError.httpDecoder: Register an `HTTPMessageDecoder` using `ContentConfig`. Use one of the decoding methods that accepts a custom decoder. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift:20)
[ ERROR ] VaporError.httpDecoder: There is no configured `HTTPMessageDecoder` for content type: text/plain. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift:64)
[ DEBUG ] Suggested fixes for VaporError.httpDecoder: Register an `HTTPMessageDecoder` using `ContentConfig`. Use one of the decoding methods that accepts a custom decoder. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift:20)
[ ERROR ] VaporError.httpDecoder: There is no configured `HTTPMessageDecoder` for content type: text/plain. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift:64)
[ DEBUG ] Suggested fixes for VaporError.httpDecoder: Register an `HTTPMessageDecoder` using `ContentConfig`. Use one of the decoding methods that accepts a custom decoder. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift:20)
[ ERROR ] VaporError.httpDecoder: There is no configured `HTTPMessageDecoder` for content type: text/plain. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift:64)
[ DEBUG ] Suggested fixes for VaporError.httpDecoder: Register an `HTTPMessageDecoder` using `ContentConfig`. Use one of the decoding methods that accepts a custom decoder. (/Users/Mercury/Desktop/vapor/tilm/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift:20)

github
https://github.com/lifesound/tilm

How do you send your requests?

Looks like you have to set the correct content-type. "Content-Type" : "application/json" when sending the request.

How to do that depends on how you send your requests.

2 Likes

Rested … json encoded

yes i noticed it again thx Boss … solved