What's the difference between a programmatically request and a 'real' one? - network-programming

I'll try to be more precise.
What's the difference between a request programatically created using all the request headers that appear in the Network tab from the Google Chrome Dev Tools and a 'real' one?
Or, in other words: could the server notice when I'm using the programatically created and when I'm using the 'real' one if I send a programatically generated request using all the request headers that Chrome says I'm sending when doing the 'real' request?

Related

Can I use the Google Picker API in an electron app?

I'm trying to use the Google Picker API to display a picker for the user to select a file. I have this working great in a web app (in a normal browser), but when I run the same code in an electron app, I see a 400 message in the popup iframe, and get the following console errors:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://docs.google.com') does not match the recipient window's origin ('file://').
Failed to load resource: the server responded with a status of 400 ()
The core problem seems to be that the electron browser window has an origin of file://. This seems to cause two problems:
The (chromium) browser security blocks the cross-origin iframe communication
Google rejects the request as not coming from a valid origin (and you can't add file:// as an origin in the developer console)
I can't think of any way to overcome these problems, but I'm hoping that someone has an idea.
You could create an app and host it in something like following, and then point the electron BrowserWindow to the url.
https://app.yourdomain.name/gdrive/picker?token=access_token
That should work I believe.

Default Request Header of IOS WKWebview and RN-Webivew

I have trouble with RN-webview when rendering my page on IOS machines in China.
For the details,
My page(server) is in Korea and clients are in China.
When trying to access page via browser app and pure swift WKWebview app, my page can be rendered.
When trying to access page via RN-Webview, can't render my page.
(NSURLErrorDomain Code=-1005. The network connection was lost.)
So, I think, there are some difference between RN-Webview and WKWebview so they makes this error.
For the first step, I'm going to check what kind of default values are set in request header of WKWebview.
It is because my page is failed with -1005 error which is about connection.
When google this issue, many people said it can be about header issue.
In the nutshell, where can I check the default values of WKWebview and RN-Webivew request headers?

PowerApps Custom Connector returns 404 in app builder

I'm trying to create a connection to an external OData API from PowerApps.
I've created a custom connector via a Postman collection - the custom connector appears to work correctly in test mode but as soon as I try to consume it in the PowerApp I always get a 404 error popup in the expression editor.
Checking the POST request made to https://europe-001.azure-apim.net/invoke and re-playing it with all headers via Postman results in the same 404 error:
{
"statusCode": 404,
"message": "Resource not found"
}
Testing the API in the PowerApps Swagger editor comes back with the results, but instead of a POST to the above URL where headers are sent with the API endpoint address, a GET is made instead.
If I replay this GET request with the same headers etc, I get the same 404. The only thing that changes per request is x-ms-client-request-id so I assume this is to prevent XHR replays.
Am I missing some publishing step for my custom connector?
Has anyone got something like this working?
Edit:
Interestingly - I tried this with a basic API at jsonplaceholder.typicode.com and this works. The API requires no auth and returns data to my Powerapp without an issue.
I'm not sure why this is different from the other custom connector apart from the authentication mechanism.
Edit edit:
This may be a bug in PowerApps - MS support are looking into it for me and another user stated their connectors stopped working since the October release with the same error.

How To Build an API URL using Postman Chrome extension

Currently interning in a mobile dev company.
Working on a task that they assigned to me.
Need to build an explore screen that receives JSON data.
They have their JSON data coming through Postman chrome extension.
I have authorization token and sample username/password.
As well as something that looks like a link that I can modify:
https://nameoftheapp.nameofthecompany.com/api/v1/search/surveys/app?searchCategory=explore&limit=10&offset=0&location=global
All iOS json tutorials shows that I need an API url.
How Can I build such URL?
edit:
here is what I've been given - the Postman chrome extension:
(sorry, had to hide some details because of non disclosure agreement)
Postman assist you in testing the functionality you have built into an API. These functionalities can be accessed by typing in the URL and then using the GET, POST, PUT etc HTTP requests.
I think maybe this video can assist you in learning more about Postman - Javabrains does a great job at explaining it:
http://javabrains.koushik.org/courses/javaee_jaxrs/lessons/Installing-A-Rest-Api-Client

How to see in fiddler what is posted to server

I installed fiddler and made a GET request. It gives me what is returned from the server in header and cookies etc. Now I want to know the way to check (using fiddler) what is being posted to the server when I post a form (with some values in text boxes using firefox or any browser). Remember I am not seeking to know the way to compose a post request in fiddler. I want to know what browser sends to the server. Actually compose a post request is not working and it returns that same page which I post, so I want to know what browser is doing which I am unable to do?
Thanks in advance.
Click on the request that you wish to see in Fiddler, right click and select "Decode Selected Sessions".
If you're saying: "I don't see any traffic in Fiddler's Web Sessions list when sending a POST from Internet Explorer", you should follow the troubleshooting steps listed here: https://groups.google.com/forum/#!topic/httpfiddler/SsZnGxdxklg
If the target page is HTTPS, you need to ensure that you enable HTTPS decryption or you won't see anything other than the CONNECT tunnel through which HTTPS traffic flows.
Otherwise, if you do see the POST in the Web Sessions list, double-click it to activate the Inspectors tab. Use the Web Forms tab or the the Raw tab to see the data posted from the client application.
You might want to watch the Fiddler tutorial videos to quickly get up to speed on how to use Fiddler: http://www.youtube.com/playlist?list=PLvmaC-XMqeBbw72l2G7FG7CntDTErjbHc

Resources