private Sub SendCommand(workName As String, Command As String, Signature As Boolean, url as String)
Dim ToSing As String
If Signature Then
url = X_PrivateUrl
ToSing = "command=" & workName & "&" & Command & "&nonce=" & DateTime.Now
Dim Sign() As Byte
Sign = Functions.HashHmac(ToSing, Functions.GetSecret)
Dim API_Signed As String
Dim Byte_Conv As ByteConverter
API_Signed = Byte_Conv.HexFromBytes(Sign) 'convert to HEX
API_Signed = API_Signed.ToLowerCase
Else
url = url & "?command=" & workName & Command
End If
Dim j As HttpJob
j.Initialize(workName, Me)
j.PostBytes(url, ToSing.GetBytes("UTF8"))
If (Signature == True)Then
j.GetRequest.SetHeader("Key", Functions.GetKey)
j.GetRequest.SetHeader("Sign", API_Signed)
'j.GetRequest.SetHeader("nonce", nonce)
End If
End Sub