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.
Related
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'])
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'm scraping http://www.germandeli.com/Meats/Sausages
I would like to extract the link for every product(or item) from the page. I use scrapy shell to test but it keeps return the empty value [ ].
Here is the code I use:
response.xpath('*//h2[#class="item-cell-name"]/a/#href')
Any helps would be greatly appreciated.
Well unfortunately the item content is rendered through JS. But luckily the URL sends a AJAX request to fetch a JSON of the items. This makes it much easier for us to parse it. You can check the XHR tab in the google chrome console to imitate the request with the required headers.
This URL returns the list of products. The limit and the offset parameters in the URL can be played around with to fetch the next set of data. Also to parse the JSON content you can use json.loads from the standard library.
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.
I am sending an AJAX request to an SQL Server and I should receive a bmp file from the blob field.
How am I going to display this at the end of the request?
So far I tried to put the response to the src attribute of an image.
But this does not work.
I am working with IE8.
AJAX expects a text response, not binary. You'd need to BASE-64 encode the response (on the server) and feed it back in to your image's SRC.
See: http://css-tricks.com/data-uris/
EDIT: Alternately you can make call for the binary data directly, just output the image tag in a format like this:
<img src="getImage.php?imageID=xxxxxx">
What happens in "getImage" is it sends out a MIME header for and image, then streams out the binary.
Something like this.