Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add headers, form data options when upload snap. #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

t-walker-wei
Copy link

Add form data, request headers when upload snap.
Call: Webcam.upload(image_data_uri, target_url, post_data, callback, headers)
post_data and headers are js objects and optional.

@bgxerjoe
Copy link

bgxerjoe commented Aug 8, 2021

in Laravel you must add csrf_token() to prevent page expired (419 error)

function saveSnap(){
var base64image = document.getElementById("imageprev").src;
Webcam.upload( base64image, 'url',{ _token: "{{csrf_token()}}"}, function(code, text) {
document.getElementById("id_image").value = text;
});
} #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants