How to read data using POST method instead of GET in Postman? - post

I've been told to use POST method to read data instead of the GET method. The tool I'm using is Postman. How can I use POST to fetch data/resources from the server?? I'm testing using any of the testing websites like reqres, gorest, etc.
Tried nothing as of now

Your question isn't really clear but if this api you use exposes a POST method to read data, that means that simply instead of sending a GET request to said URL, you should send a POST http request and the response will be the data you fetched.
On the contrary, if you are composing this api yourself and asking here how to do it, you could simply create a meathod for fetching data and expose this method to a POST request.

Related

What is the advantage of using a GET http method to update values as opposed to POST http method?

I was reading up on how to create a telegram bot and I see that to set a web hook you use the GET http method. I assume that your link will be stored somewhere on telegram servers.
So now my question is:
Why not use the POST http method? What is the advantage of this design of using GET http method in this case rather than POST http method for something that pushes data?
Bot API supports GET and POST HTTP methods both. It's up to you what to use. (See this or this). I think it makes the API easy and fast to get started with.
For the sake of simplicity one might choose a simple GET request to set a webhook - Put together a Url with some parameters and call it in a web browser, done! Webhook is now set.
Still it is possible to do the same with a POST request (and you can argue it is the preferred way to do so). But it would need tools like Postman, CURL or some browser extensions.

bubble.io Question: API/raw HTTP post access?

I'm working on getting a Bubble API connection set up. I'm trying to make an API POST call using json to a REST API and it’s saying I haven’t actually sent any parameters in my JSON. Does anyone familiar with Bubble know how I can see the raw HTTP post that Bubble is sending?

Ruby on Rails: Capturing JSON data from webhook?

I'm trying to understand how webhook works. My understanding is that its the ability to connect two different applications. If I submit a webhook with url
localhost:3000/receiver
to one application, and I have my application with a method
def receiver
end
I was wondering if I don't know what the callback is from the webhook would be, how would I capture data? How do I save any JSON data thats communicating with my application? I was thinking maybe save some file to see what the objects are, but I'm still fairly new and not sure how to capture JSON data?
Thanks
If you are sure that the webhook is returning a JSON, you can so something like this
data_json = JSON.parse request.body.read
Sure, a webhook a is tool to sincronize two apps
You HAVE tou know the structure of the incoming json, because you need to get the info inside
By definition a webhook is sent by POST method, so you can capture it just inspecting the body of the petition, i.e.
webHook = JSON.parse(params[:something])
Your would try with github web hooks and publish your app in heroku, the api is very well documented and there are many examples.

Posting JSON data to Web API - where do I even start?

I have zero experience with Web API and JSON. My requirements are to create a service (I'm using Web API for this) that will accept MIME Encoded JSON data. The service will take that data, insert it into a database, and return the primary key value back to the client.
My hang-up is being able to know where to even start with this. A couple of questions that I have are:
When the device sends the JSON data, how will the service "accept" it? Meaning, what's being passed to the service isn't an URL that we commonly see with MVC (/Controller/Action/ID) which then invokes the Action Method. So, how will the service know what to invoke if I'm passing raw JSON data?
How would I test this if I don't have a device that sends the JSON data yet? Would I manually invoke an AJAX call and call that particular action method and pass in the JSON data that way?
I apologize for the seemingly elementary questions.
Thanks.
When you call a WebAPI-method you still have to specify the endpoint:
Example:
PUT /api/people
MVC knows from that that it should call the put-method on the PeopleController.
You can send raw JSON-data to test it. A good tool for that is HttpFiddler: http://fiddler2.com/
As for where to start, try to create a basic WebAPI-project with visual studio, it will include some samples and you can get going from that. If you run into wall, you can come back here

How to Tamper HTTP requests which are mix of GET and POST

We can use Tamper Data for tampering the POST requests, but I want to know if there is any tool to tamper the requests which are mix of GET and POST
like : http://example.com/?time=123456&date=22-12-2012
and also have associated POST data.
With Tamper Data I can only change the POST parameters and not GET, and if I use another way to change GET parameters, I loses the POST data.
Try fiddler. That gives you control over GET and POST data (the entire request in general) and should be able to do what you desire.
It even has its own associated FiddlerScript which helps automate handling (redirection, editing, etc) of web requests.

Resources