Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifailon authored Sep 29, 2023
1 parent 8538b34 commit af9db07
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

This is a simple netcat server that accepts and processes endpoint requests to manage Linux-based services (systemctl).

Only the GET method is supported for **PowerShell 7 (Invoke-RestMethod or Invoke-WebRequest)**. The endpoints used: \
Supported only the GET method for **PowerShell 7 (Invoke-RestMethod or Invoke-WebRequest)**.

**Curl is not supported!** Curl does not wait for additional time from the server to get a complete response to the request (same with irm/iwr and POST method), **unlike Invoke-RestMethod and GET method in PowerShell 7**, it waits for a complete response from the server before returning the result of the request. In the case of netcat, the utility does not terminate the connection until the server sends a complete response. The result of the request is stored in a buffer/stream and gives back the response of the previous request when the client makes a subsequent request.

**The endpoints used:** \
`/api/date` \
`/api/disk` \
`/api/service/service_name`

**Curl is not supported!** Curl does not wait for additional time from the server to get a complete response to the request (same with irm/iwr and POST method), **unlike Invoke-RestMethod and GET method in PowerShell 7**, it waits for a complete response from the server before returning the result of the request. In the case of netcat, the utility does not terminate the connection until the server sends a complete response. The result of the request is stored in a buffer/stream and gives back the response of the previous request when the client makes a subsequent request.

**Request syntax for send:** \
`irm http://192.168.3.101:8081/api/service/cron -Method Get` \
`irm http://192.168.3.101:8081/api/service/cron -Method Get -Headers @{"Status" = "restart"}` \
Expand Down

0 comments on commit af9db07

Please sign in to comment.