Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
2.1 kB
1
Indexable
Never
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("fahr-zeit.europersonal.com")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=bewerbung;'))

dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))

dataList.append(encode('''{
  "Bewerbung": {
    "BeworbenAls": "string",
    "Mandant": {
      "ObjectUuid": "f70c12a2-cc5c-4cc6-ae52-769ca67c92c8",
      "Bezeichnung": "Berlin"
    },
    "Quelle": {
      "ObjectUuid": "5ec198e0-4cbf-4080-96b4-60d3bb0d4345",
      "Bezeichnung": "wellemachen"
    },
    "QuelleFreitext": "wellemachen",
    "Stelle": {
      "ObjectUuid": "1be52824-d77e-481f-9cec-ea80fd9a1f93",
      "Bezeichnung": "LKW-Fahrer C/CE im Nahverkehr (m/w/d)",
      "MandantUuid": "f70c12a2-cc5c-4cc6-ae52-769ca67c92c8"
    }
  },
  "Mitarbeiter": {
    "Adressen": [
      {
        "Ort": "string",
        "Plz": "string"
      }
    ],
    "Anrede": {
      "ObjectUuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "Bezeichnung": "string"
    },
    "BenutzerdefinierteEigenschaften": [
      {
        "Name": "WeitereInformationen",
        "Wert": "Testinfo Bewerber"
      }
    ],
    "Email": "test@test.de",
    "Nachname": "Metzler",
    "Telefon": "0744312345",
    "Vorname": "Tormas"
  },
  "Skills": [],
  "Werdegaenge": []
}'''))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
  'X-ApiKey': 'LBBXstYd6H7fCmMI0v1EFeKALeY+GRU5Gn7opYaG7GY=',
  'Cookie': 'ARRAffinity=adbe40b8f5e4f2b80fe981c251d8481540ea0d8c04cfee9349b5c73bb90f8bfe; ARRAffinitySameSite=adbe40b8f5e4f2b80fe981c251d8481540ea0d8c04cfee9349b5c73bb90f8bfe',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/api/public/v1/Bewerbung/Create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Leave a Comment