i'm trying to test some REST's API with Postman. When I click on Params button and enter a key and value my URL is something like www.example\rest\api?key=value, my API does not support query parameters, is there any way to pass like a matrix parameter something like www.example\rest\api;key=value or should I enter manually in URL area?
If your API expect the input as part of the request body you should pass the keys/values using the form-data button in Postman.
Related
I am trying to get list of products from api. i requested url with get method and response code is 200. but how can i get to see list of products in postman?
https://url/Product/all
Looks like you are getting the response in HTML format; you just need to scroll down in the response body to see them. Change your response body format from HTML to JSON. You should be able to see the JSON.
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
I have an API which redirects to browser and on that we have to enter username and password.
The API returns the HTML page as part of the response. How from HTML response we can pick username and password via locator Id and click button?
I have tried below but as it is returned in the response I somehow need to tell where in response find that field and input.
And input('#username', 'username')
And input('#password', 'password')
When click('#kc-login')
What I would do is scrape any information needed out of the HTML like this: https://stackoverflow.com/a/61605535/143475
And then form an HTTP request to do what the clicking of the button actually does. Remember no matter what HTML and complex JS / UI you see, finally everything becomes some HTTP request. Use the developer tools "network" part of the browser to figure this out.
The rest is up to your creativity. Work with some web-developers if required.
I have a Vue application that is using mongodb and flask for the back-end. I am trying to test the code as follows.
There is a form as you can see from the image above. When I enter the URL's, tokens, password, ssh, and project name, and click Create button, I add them to an object and send them to the database in a request.
I want to write these values in Cypress.js (this part is done), and click the create button. After clicking create button I want to test the data that is sent as request. How can I reach the body in the request in cypress?
You can use cy.intercept() to look at outbound requests. Request object documentation here.
cy.intercept('/some/url', (req) => {
// whatever you need to do with the request object
// for example, validating the request body has a name field
expect(req.body.name).to.equal('My Body Object Name');
// req.continue() tells the request to continue!
req.continue()
});
I have created a JSP page, which will accept parameter. Once the page received the parameter, it will return an XML to user.
I want to create a VB program, that will display a form and ask user to enter the value of the parameter, and then will pass it to the JSP page, and get the return XML and display it to user in VB program.
Is it possible to do so?
Thx
Use the HttpRequest class to request a web page. Then just manipulate the URL to add query string parameters. If you need to do this via a POST request (versus GET), write the parameters in the body.