Я получаю ошибку Ожидаемое значение: строка 1, столбец 1 (символ 0) при попытке создать новый продукт woocommerce с использованием woocommerce rest api в моем проекте python.
Ошибка возникает при create_woocommerce_product_individually()
function
URL-адреса, передаваемые в список photo_gallery_dictionary_list, работают нормально.
def create_woocommerce_product_individually(wcapi_yachtcharterapp,mixed_name,fetched_sku,short_description,description,woo_commerce_category_id,photo_gallery_dictionary_list):
data = {
"name": mixed_name,
"sku": fetched_sku,
"images": photo_gallery_dictionary_list
}
wcapi_yachtcharterapp.post("products",data).json()
Traceback:
File "/www/wwwroot/yachts_management/yachts_manage_venv/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/www/wwwroot/yachts_management/yachts_manage_venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)
File "/www/wwwroot/yachts_management/yachts_manage_venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/www/wwwroot/yachts_management/yachts_management/intranet/views.py" in update_woo_products_from_mmk_yachts_massive
1651. update_woo_products_from_mmk_yachts_individual(mmk_yacht)
File "/www/wwwroot/yachts_management/yachts_management/intranet/views.py" in update_woo_products_from_mmk_yachts_individual
1573. create_woocommerce_product_individually(wcapi_yachtcharterapp,mixed_name,fetched_sku,short_description,description,woo_commerce_category_id,photo_gallery_dictionary_list)
File "/www/wwwroot/yachts_management/yachts_management/intranet/views.py" in create_woocommerce_product_individually
1107. wcapi_yachtcharterapp.post("products",data).json()
File "/www/wwwroot/yachts_management/yachts_manage_venv/lib/python3.7/site-packages/requests/models.py" in json
897. return complexjson.loads(self.text, **kwargs)
File "/www/wwwroot/yachts_management/yachts_manage_venv/lib/python3.7/site-packages/simplejson/__init__.py" in loads
525. return _default_decoder.decode(s)
File "/www/wwwroot/yachts_management/yachts_manage_venv/lib/python3.7/site-packages/simplejson/decoder.py" in decode
370. obj, end = self.raw_decode(s)
File "/www/wwwroot/yachts_management/yachts_manage_venv/lib/python3.7/site-packages/simplejson/decoder.py" in raw_decode
400. return self.scan_once(s, idx=_w(s, idx).end())
Exception Type: JSONDecodeError at /private/update_woo_products_from_mmk_yachts_massive/
Exception Value: Expecting value: line 1 column 1 (char 0)