editor
Replace String
Replaces all occurrences of a string in a file with a new string.
POST
/
api
/
editor
/
str-replace
Copy
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"
}'
Copy
This response does not have an example.
Body
application/json
Response
204
Successfully replaced string
Copy
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"
}'
Copy
This response does not have an example.
Assistant
Responses are generated using AI and may contain mistakes.