Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I bring a HTML Image to the backend?

I have a middleware:

export async function imageTagging(image){
    console.log(image)
    const response = await axios.get('/api/tensorflow', {
        image: image
    });
    return response.data[0];
}

which logs me (image):

<img data-v-713aaf8f="" id="MLIMAGE" src="/img/Erdmännchen.b5f674c2.jpg" width="50%" crossorigin="anonymous" class="card-img-top embed-responsive-item" style="border-style: solid;">

my API-Call in the backend looks like:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

 app.get('/api/tensorflow', userMiddleware.isLoggedIn, (req, res) => {
  console.log(req.query);
  console.log(res.query);
})

it logs me:

{}
undefined

>Solution :

First of all, you are doing a GET request. You can’t post data to a /GET endpoint. You need a /POST.

Secondly, req.query is an object of key-value pairs of query parameters, which in your case is rightfully empty. So I don’t understand, what is your exact question?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading