Skip to main content
POST
/
api
/
editor
/
str-replace
Replace String
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"
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Body

application/json
path
string
required

File path to modify

Example:

"/path/to/file.txt"

old_str
string
required

String to replace

Example:

"old text"

new_str
string
required

Replacement string

Example:

"new text"

Response

Successfully replaced string