Search MFA Status
1 min
code examples curl request post \\ \ url {{url}}/twofactorauth ui/rest/tfa/otpstatus \\ \ header 'accept application/json' \\ \ header 'content type application/x www form urlencoded' \\ \ header 'x xsrf token {{csrftoken}}' \\ \ form 'username="admin"'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/x www form urlencoded"); myheaders append("x xsrf token", "{{csrftoken}}"); var formdata = new formdata(); formdata append("username", "admin"); var requestoptions = { method 'post', headers myheaders, body formdata, redirect 'follow' }; fetch("{{url}}/twofactorauth ui/rest/tfa/otpstatus", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "net/http" url = uri("{{url}}/twofactorauth ui/rest/tfa/otpstatus") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/x www form urlencoded" request\["x xsrf token"] = "{{csrftoken}}" form data = \[\['username', file open('undefined')]] request set form form data, 'multipart/form data' response = http request(request) puts response read body import requests url = "{{url}}/twofactorauth ui/rest/tfa/otpstatus" payload = {} files=\[ ] headers = { 'accept' 'application/json', 'content type' 'application/x www form urlencoded', 'x xsrf token' '{{csrftoken}}' } response = requests request("post", url, headers=headers, data=payload, files=files) print(response text) responses false