Possibly but what about the old method works that is different from the httpclient I wonder? Below is the old and new way I'm trying to send the data. This is only a portion of the total function, but everything outside of these sections is the same
This is the way I am doing it today and is working as expected
data = {
'Company': "WCI",
'Key1': "PLCLoggedData",
'Key2': res,
'Key3': "",
'Key4': "",
'Key5': str(int(time.time())),
'Date01': datetime.date.today().strftime("%Y-%m-%d"),
'Number01': str(seconds_since_midnight),
#'Number02': meter,
'Number03': bpm,
'Number04': bpmtarget,
#'Number05': 0.00,
'Number06': currmeter,
'ShortChar01': jobnum,
'CheckBox01': status
}
conn = httplib.HTTPSConnection(settings[0].value)
conn.request("POST", "/" + str(settings[1].value).strip() + "/api/v2/odata/WCI/Ice.BO.UD02Svc/UD02s", json.dumps(data), BuildEpicorHeaderInfo(settings))
This is the new way I'm trying to do that is causing the error
payload = {
'Company': "WCI",
'Key1': "PLCLoggedData",
'Key2': res,
'Key3': "",
'Key4': "",
'Key5': str(int(time.time())),
'Date01': datetime.date.today().strftime("%Y-%m-%d"),
'Number01': seconds_since_midnight,
#'Number02': meter,
'Number03': bpm,
'Number04': bpmtarget,
#'Number05': 0.00,
'Number06': currmeter,
'ShortChar01': jobnum,
'CheckBox01': status
}
response = httpClient.post(url = BuildEpicorEndpointURL(settings, endpoint), data = payload, params = getvars, headers = BuildEpicorHeaderInfo(settings))
I am going to run fiddler on my Epicor server and watch for the incoming request to see the difference between the two. It will take me a bit to setup, but I'll report back later.