`unknown command` error code
The unknown command error is a WebDriver error that occurs when the driver does not recognize the command/HTTP endpoint.
The **unknown command** error is a [WebDriver error](/docs/Web/WebDriver/Reference/Errors) that occurs when the driver does not recognize the command/HTTP endpoint.
## Examples
The `/session/{session id}/foo` endpoint does not exist, and will return an unknown command error with a [`404 Not Found`](/docs/Web/HTTP/Reference/Status/404) HTTP status code:
```bash
curl -i -d '{}' http://localhost:4444/session/foo
```
```http
HTTP/1.1 404 Not Found
Connection: close
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
Content-Length: 113
Date: Fri, 30 Mar 2018 15:30:51 GMT
{"value":{"error":"unknown command","message":"POST /session/asd did not match a known command","stacktrace":""}}
```
## See also
- [List of WebDriver errors](/docs/Web/WebDriver/Reference/Errors)
- [List of WebDriver commands](/docs/Web/WebDriver/Reference/Classic/Commands)
Cite this
"`unknown command` error code". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/WebDriver/Reference/Errors/UnknownCommand JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy