Hallo
Ich möchte gerne mittels eines
Es handelt sich hier um ein GCode File für den 3D-Drucker welches ich gerne an OctoPrint senden möchte.
Folgendes steht in der OctoPrint API um das File hochzuladen:
Und das ist mein bisheriger Code:
Meine Frage ist, wo gebe ich jetzt den Pfad des zu hochladendem Files an und wie muss ich den API Key einbinden?
Freundliche Grüsse
Ebrithil
Ich möchte gerne mittels eines
WebRequest
ein Textfile hochladen.Es handelt sich hier um ein GCode File für den 3D-Drucker welches ich gerne an OctoPrint senden möchte.
Folgendes steht in der OctoPrint API um das File hochzuladen:
Quellcode
-
- POST /api/files/sdcard HTTP/1.1
- Host: example.com
- X-Api-Key: abcdef...
- Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMC
- ------WebKitFormBoundaryDeC2E3iWbTv1PwMC
- Content-Disposition: form-data; name="file"; filename="whistle_v2.gcode"
- Content-Type: application/octet-stream
- ;Generated with Cura_SteamEngine 13.11.2
- M109 T0 S220.000000
- T0
- ;Sliced at: Wed 11-12-2013 16:53:12
- ;Basic settings: Layer height: 0.2 Walls: 0.8 Fill: 20
- ;Print time: #P_TIME#
- ;Filament used: #F_AMNT#m #F_WGHT#g
- ;Filament cost: #F_COST#
- ;M190 S70 ;Uncomment to add your own bed temperature line
- ;M109 S220 ;Uncomment to add your own temperature line
- G21 ;metric values
- G90 ;absolute positioning
- ...
- ------WebKitFormBoundaryDeC2E3iWbTv1PwMC
- Content-Disposition: form-data; name="select"
- true
- ------WebKitFormBoundaryDeC2E3iWbTv1PwMC
- Content-Disposition: form-data; name="print"
- true
- ------WebKitFormBoundaryDeC2E3iWbTv1PwMC--
Und das ist mein bisheriger Code:
Meine Frage ist, wo gebe ich jetzt den Pfad des zu hochladendem Files an und wie muss ich den API Key einbinden?
Freundliche Grüsse
Ebrithil