I am trying to include an image in my og:image meta tag that loads the image of a specific shop dynamically that is being shared by a user that is using my app when he wants to share the shop through WhatsApp so that it would show a thumbnail with the title, description, and image of the shop.
but it doesn't load so I went and opened developer tools and inspected the element of my meta tag I found that the URL leads to this error:
{
"error": {
"code": 400,
"message": "Invalid HTTP method/URL pair."
}
}
here is my code:
landing page of the shared link:
<meta property="og:title" content="<?php echo $_GET["title"]; ?>" />
<meta property="og:description" content="<?php echo $_GET["desc"]; ?>"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content=""/>
<meta property="og:image" content ="<?php echo $_GET["img"];?>"
Sent URL:
https://MyWebsiteName.com/share/?shop=xJbOcJDm1EOAkQdj0P3Q&title=Sorso&desc=Proudly%20Serving%20Gardelli%20Specialty%20Coffees&img=https://firebasestorage.googleapis.com/v0/b/myappname-9ff0f.appspot.com/o/Profile%20Image%2FxJbOcJDm1EOAkQdj0P3Q%2F125819259_2799019546979252_3099556570327477479_n.jpeg?alt=media&token=10450a78-d240-4f88-bb47-e809f91937c6
meta tag inspection:
<meta property="og:image" content="https://firebasestorage.googleapis.com/v0/b/myappname-9ff0f.appspot.com/o/Profile Image/xJbOcJDm1EOAkQdj0P3Q/125819259_2799019546979252_3099556570327477479_n.jpeg?alt=media"/>
What's the problem and how can I load the firebase storage image URL correctly into the meta tag?
EDIT:
including firebase storage token in the url passed but still getting the same error:
{
"error": {
"code": 400,
"message": "Invalid HTTP method/URL pair."
}
}
<meta property="og:title" content="<?php echo $_GET["title"]; ?>" />
<meta property="og:description" content="<?php echo $_GET["desc"]; ?>"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="<?php echo $_GET["img"].""."&token=".$_GET["token"]; ?>"/>
<meta property="og:image" content ="<?php echo $_GET["img"].""."&token=".$_GET["token"];?>"/>
i believe the problem is that the meta tag is converting the encoding for "/" symbol from %2F to "/" and thats why it is invalid. how do i make the meta tag not do that for my url?
