cURL
curl --request POST \ --url http://localhost:4242/{computer_name}/api/editor/str-replace \ --header 'Content-Type: application/json' \ --data '{ "new_str": "new text", "old_str": "old text", "path": "/path/to/file.txt" }'
This response does not have an example.
Replaces all occurrences of a string in a file with a new string.
File path to modify
"/path/to/file.txt"
String to replace
"old text"
Replacement string
"new text"
Successfully replaced string