Embed a URL in a simple http request - httprequest

I'm making a simple http request that looks something like this:
https://example.com/api/chat.postMessage?text=This%20should%20be%20a%20link
What this does is posts a message to our internal chat service. The text= is the text that gets posted to the chat channel. What I'd like is to embed a hyperlink here so that when the message is posted, "This should be a link" will actually link to an http link. Is this at all possible? Thanks!

Looks like you're working with the Slack API? The following two links could be helpful:
the chat.postmessage method
testing the method call
To encode the following text...
"go to http://www.google.com/"
...it seems that you would send a request to the following URL:
.../api/chat.postMessage?text=go%20to%20http%3A%2F%2Fwww.google.com%2F

Related

I'm having problems making bunnystream API requests with Vuejs fetch

I need to send a post request to the bunnynet api using fetch in vuejs, for this I need to enter the name of the video in the body part.
I want to name the video with the variable I got from the input section, but I couldn't write it as a body. I can send requests statically, but I need to get the name of the video I will create from outside. I couldn't find a solution, I'm stuck on this, can you please help?
enter image description here
enter image description here
I tried to send the value I received as an object or as a string, unfortunately nothing happens.
body: JSON.stringify({
// your expected POST request payload goes here
title: "My post title",
body: "My post content."
})
it worked, i'm so ignorant

How to get request headers in instagram.com

I'm working on a small-scale instagram scraping project mainly using selenium and the python requests module. I discovered that when the Request Header changes for www.instagram.com, the text that I get from using
requests.get("https://www.instagram.com/<address>/?__a=1")
Returns the HTML code for the webpage. Instead I was expecting it to be the json text containing post details. Currently, it works fine if I change the headers manually.
How do I automatically get the request header using selenium or requests? I'm expecting to get the text labeled in the image attached:
www.instagram.com Request Header
Thank you.
import requests
response = requests.get("https://www.instagram.com/<address>/?__a=1")
print(response.status_code)
print(response.headers)
print(response.json())
As I see in the headers printed out on to console, there is a set-cookie header. If this is something that you are looking for, then you may use this line to extract only this header:
print(resp.headers['Set-Cookie'])

Api Response Body and Headers in Laravel

I am unable to get specific data and need you guys' advice on how I can retrieve it.
I am using a curl as a post to submit through an Api in postman and in sucess I only get empty string but the response that I need is there in the headers on the headers tab next to body the image is below
api response shows in headers click for image view
I have used getHeaders and many more functions to get but failed to get anything yet so please guide me that should i do.
Thanks

What is the correct syntax for a post url to Google Sheets which includes an API key?

I am trying to post data to a Google Sheet (via a Gravity Forms form submission in WordPress).
My post url looks like this:
https://sheets.googleapis.com/v4/spreadsheets/1S45-------w3u1A/values:batchUpdate&key=AI-------KxIiBcD8
But I get this response:
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
404. That’s an error.
The requested URL /v4/spreadsheets/1S45-----3u1A/values:batchUpdate&key=AI----KxIiBcD8 was not found on this server. That’s all we know.

telegram bot, callback query of an inline button in a group chat, redirect the user to private chat of bot. python

My bot sends messages to groups with inline button, what I want, is when the button is clicked, chat with the bot page should open, i.e. somehow redirect the user to the private chat with the bot.
I'm using this wrapper.
What I have tried so far is to set a url in answer_callback method, equal to the url of my bot i.e. url="https://t.me/my_sample_bot
but I keep getting URL_INVALID response from telegram, I tried http(since I read somewhere in the api documentation that the urls should be HTTP), but that did not work either.
My question is am I doing it right? I mean do I have to set the url in answer_callback method to redirect the user, or I should try another way?
Well I figured it out myself, setting the url was the right way to do it, and though the Wrappers documentation is not detailed, I took a look at source code and there was a docstring for the method answer_callback_query that said this about the url:
:param url: (Optional) URL that will be opened by the user's client. If you have created a Game and accepted the conditions via #Botfather, specify the URL that opens your game – note that this will only work if the query comes from a callback_game button.
Otherwise, you may use links like telegram.me/your_bot?start=XXXX that open your bot with a parameter.
so all I had to do was to give it a link with of my bot, with a start query