{"record":{"id":"197b274e14b7c4bd","repo":"HumanSignal/label-studio","slug":"url-is-not-found-in-request-data-197b27","errorCode":null,"errorMessage":"\"url\" is not found in request data","messagePattern":"\"url\" is not found in request data","errorType":"validation","errorClass":"ValidationError","httpStatus":400,"severity":"error","filePath":"label_studio/data_import/uploader.py","lineNumber":363,"sourceCode":"    could_be_tasks_list = False\n\n    # take tasks from request FILES\n    if len(request.FILES) > 0:\n        check_request_files_size(request.FILES)\n        check_extensions(request.FILES)\n        for filename, file in request.FILES.items():\n            file_upload = create_file_upload(request.user, project, file)\n            if file_upload.format_could_be_tasks_list:\n                could_be_tasks_list = True\n            file_upload_ids.append(file_upload.id)\n        tasks, found_formats, data_keys = FileUpload.load_tasks_from_uploaded_files(project, file_upload_ids)\n\n    # take tasks from url address\n    elif 'application/x-www-form-urlencoded' in request.content_type:\n        # empty url\n        url = request.data.get('url')\n        if not url:\n            raise ValidationError('\"url\" is not found in request data')\n        if len(url) > 2048:\n            raise ValidationError('\"url\" must be 2048 characters or fewer')\n\n        # try to load json with task or tasks from url as string\n        json_data = str_to_json(url)\n        if json_data:\n            file_upload = create_file_upload(request.user, project, SimpleUploadedFile('inplace.json', url.encode()))\n            file_upload_ids.append(file_upload.id)\n            tasks, found_formats, data_keys = FileUpload.load_tasks_from_uploaded_files(project, file_upload_ids)\n\n        # download file using url and read tasks from it\n        else:\n            (\n                data_keys,\n                found_formats,\n                tasks,\n                file_upload_ids,\n                could_be_tasks_list,","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/data_import/uploader.py#L345-L381","documentation":"When a sync import request uses content type application/x-www-form-urlencoded, Label Studio reads the tasks from the 'url' form field. If that field is missing or empty, load_tasks raises this ValidationError telling the caller that no URL was supplied in the form data.","triggerScenarios":"POSTing to the import endpoint with Content-Type application/x-www-form-urlencoded but without a 'url' key in the body, or with url=''.","commonSituations":"Sending form-encoded data while intending JSON tasks; forgetting the url field; a proxy or client stripping empty form fields; curl -d without url=...","solutions":["Include a non-empty 'url' form field pointing to the task data","If you meant to send tasks inline, switch Content-Type to application/json and send a JSON array","URL-encode the form body properly (e.g. curl --data-urlencode \"url=https://...\")"],"exampleFix":"// before\ncurl -X POST $HOST/api/projects/1/import -H \"Content-Type: application/x-www-form-urlencoded\" -d \"\"\n// after\ncurl -X POST $HOST/api/projects/1/import -H \"Content-Type: application/x-www-form-urlencoded\" --data-urlencode \"url=https://example.com/tasks.json\"","handlingStrategy":"validation","validationCode":"form = {'url': task_data_url}\nassert form['url'], \"'url' form field is required for urlencoded imports\"\nrequests.post(import_url, data=form)","typeGuard":"def has_url(form):\n    return isinstance(form, dict) and bool(form.get('url'))","tryCatchPattern":"try:\n    import_via_url(url)\nexcept ValidationError as e:\n    if '\"url\" is not found' in str(e):\n        raise UserInputError('Include a non-empty url form field or switch to JSON-body import')\n    raise","preventionTips":["When using x-www-form-urlencoded, always include the url field","Use --data-urlencode in curl to build form bodies correctly","Prefer the application/json import path for inline tasks"],"tags":["validation","http","form-data","label-studio"],"backgroundTag":"missing-required-parameter","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}