king_mkv
Member
Hello my friends
I want to send a request in Basic Four Android and show a response to the user, depending on the response I get from the server.
I used to work with Python, and there it was very easy to use a site to convert curls to Python commands. Is there a way I can request a server with a header, cookie and body request?
like in python :
headers = {
'Host': 'hostname',
'User-Agent': 'UnityPlayer/2019.3.4f1 (UnityWebRequest/1.0, libcurl/7.52.0-DEV)',
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate',
'Content-Type': 'application/json',
'AUTHORIZATION': self.password,
'X-Unity-Version': '2019.3.4f1',
'Content-Length': '36',
'Expect': '100-continue',
'Connection': 'close',
}
json_data = {
'key': 'key',
'value': 1,
}
requests.put('http://hostname/api/Game/user/achievement', headers=headers, json=json_data, verify=False)
@Erel
I want to send a request in Basic Four Android and show a response to the user, depending on the response I get from the server.
I used to work with Python, and there it was very easy to use a site to convert curls to Python commands. Is there a way I can request a server with a header, cookie and body request?
like in python :
headers = {
'Host': 'hostname',
'User-Agent': 'UnityPlayer/2019.3.4f1 (UnityWebRequest/1.0, libcurl/7.52.0-DEV)',
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate',
'Content-Type': 'application/json',
'AUTHORIZATION': self.password,
'X-Unity-Version': '2019.3.4f1',
'Content-Length': '36',
'Expect': '100-continue',
'Connection': 'close',
}
json_data = {
'key': 'key',
'value': 1,
}
requests.put('http://hostname/api/Game/user/achievement', headers=headers, json=json_data, verify=False)
@Erel