

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: HTTP Clients
incomplete
2: JSON
incomplete
3: JSON Review
incomplete
4: The Profane
incomplete
This lesson's interactive features are locked, please to keep using them
Not only do we validate that Chirps are under 140 characters, but we also have a list of words that are not allowed.
We need to update the /api/validate_chirp endpoint to replace all "profane" words with 4 asterisks: ****.
Be sure to match against uppercase versions of the words as well, but not punctuation. "Sharbert!" does not need to be replaced, we'll consider it a different word due to the exclamation point.
{
"body": "This is a kerfuffle opinion I need to share with the world"
}
{
"cleaned_body": "This is a **** opinion I need to share with the world"
}
Run and submit the CLI tests.
Use an HTTP client to test your POST requests.
I'd recommend breaking the bad word replacement into a separate function. You can even write some unit tests for it!
Here are some useful standard library functions: