Don't get default picture google plus api - google-plus

Is there a way to not get the default picture URL of google plus api
When I am doing:
GET /plus/v1/people/109991090897698795916?fields=image&key=<MY_KEY> HTTP/1.1
Host: www.googleapis.com
Cache-Control: no-cache
Postman-Token: f1c6333b-29d6-ae04-332c-9dd629ecaa54
If user did not set a profile picture it returns me the default profile picture.
However I would like to not have this default profile picture. I have my own in case the picture is not defined
Do you have an idea?
Regards

If you know how default google picture looks like, I suggest that you add your own logic after the API call by removing it and replace it by your own.

Related

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

HTML page got returned as part of API response in karate. Now how to enter username and password on that?

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.

How to enter x-auth header in postman?

So I receive an API credential that asks me to enter an X-AUTH-HEADER and Content-Type.
In my postman, on the "Headers" tab, there's a "Content Type" key but I can't see an "X-Auth-Header" key. I only have "Authorization" key. Where to I enter the X-Auth-Header key then?
Custom Headers can just be manually added to the Headers section in Postman.
Just enter header name and value. You can enter anything you like -- not restricted to suggested options

How can I enable displaying website into the iframe?

I encountered a problem with displaying my website into the frame to show click map. An error is: "Refused to display 'https://balticland.ru/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'." But I don't have any prohibitions for that. Here is my .htaccess file.
I am using Drupal.
Can you advise me something?
X-Frame_Options is header option and it should be sent with header function before any output begins. Something like:
<?php header('X-Frame-Options: GOFORIT'); ?>
Drupal has special function for setting http headers:
https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_add_http_header/7.x
So it should be something like:
drupal_add_http_header('X-Frame-Options', 'GOFORIT');
Check out comments bellow function description.
Update:
Check out this documentation:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
It can be that you must specify external origin, like it states:
X-Frame-Options: ALLOW-FROM https://example.com/