swift error "Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 1."
This is an error stating that the response from the server is not valid JSON and contains unreadable characters (e.g. html) Basically it means that your upload did not go well (not accepted by server and therefore not showing json response) or that you did not setup the json response correctly and that it contains html. You can check the latter by looking at the page in your browser and checking the source.
Hope this helps!
Ps: I assume you are using a working URL in your real code right? ;-)