Apigee response not getting sent to angular application - apigee

I have an angular that sends calls to Apigee. After tracing the calls i can see that a response is returned. However the client does not get the response. I have no idea what i could be missing in this instance.
I have set up CORS correctly on Apigee and can see the options preflight response getting called successfully. The issue really is on the second call, a response is returned but the client receives null data

Well, working with the description you've sent, what you could do:
Debug the API call using the Chrome Developer tools: use ctrl-shift-J and then choose the 'network' tab. See if the clal is coming in. Clicking on the specific API call shows you the response
also maybe check the console that is shown when using above command (crl-shift-J)
indeed check the Apigee trace. But if the trace shows a reply is sent, then probably it is.
add some console.log in the Angular application or try to debug it so that you are certain it's an Angular issue.
maybe share some code so that we can better help you.

Related

How to get items from headers by learning from initiators and using request python?

I am trying to get the fingerprint as can be seen from this snapshot.
I tried searching for the fingerprint but it's not in the response or cookies. I am wondering how this fingerprintjs works so that I can imitate and return the fingerprint item.
The website is https://alfagift.id/
When you take a look into network, especially categories, there's a preflight and an xhr where it is initiated by https://alfagift.id/_nuxt/ca268e7.js
I've tried doing a requests
resp=requests.get(" https://alfagift.id/")
resp.cookies
nothing seems to be returning the fingerprint that's needed.
Can anyone show me how you can get the fingerprint?
This file's rendering and executing the fingerprinting script on the client side: https://alfagift.id/_nuxt/f9d159c.js
Proof:
__fpjs_d_m||Math.random()>=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v3.3.3/npm-monitoring",!0),t.send()}catch(t){console.error(t)}}(),[4,vt(r)];case 1:return t.sent(),[2,gt(L(ft,{debug:n},
Used library: https://github.com/fingerprintjs/fingerprintjs

sentry captureException doesnt show the entire error

I capture errors in a catch block using captureException(error); in my NextJS app.
However in Sentry it doesnt show the entire error message as I would see in the developer console. For example it only says: AxiosError: Network Error (see image below).
How can I make sure I get the entire error object?
For example, in the developer console I see this:
Access to XMLHttpRequest at 'https://www.hello.com/' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.but this is not in sentry
What you are looking at on the screenshot is called a "breadcrumb". An event that happened during the user's session.
The Access to XMLHttpRequest... is a browser network error, and it's not exposed to the JS API, so you won't be able to capture it.
If you want to investigate what's available for your network errors, you can use beforeBreadcrumb callback, as detailed in https://docs.sentry.io/platforms/javascript/enriching-events/breadcrumbs/#customize-breadcrumbs

HTTP Request fails when using the same parameters and the same environment

I'm trying to fetch data from a website (https://gesetze.berlin.de/bsbe/search). Using Mozilla, I've taken a look at the network analysis. Usually, I'm just messing around with the parameters of the POST-Request to see how I might influence the response of the server. But when I simply re-send the request (making no changes at all), I'm getting HTTP-response 500. The server answer states as message: security_notAuthenticated.
Can anyone explain that behaviour? The request is done by the same PC, the same browser in the same session, and there is no login function on that website. Pictures shown below.
Picture 1 - Code 200
Picture 2 - Code 500
The response security_notAuthenticated indicates, that your way of repeating the request omits some authentication-related information.
When I repeat the request, using Mozilla Firefox's "Resend" or "Edit and resend" function, the Cookie header is not sent with the request. Although it occurs in the editable header list when using "Edit and resend" it's missing when watching the actual sent request. I'm not sure whether this is a feature or a bug.
When using Firefox's "Use as Fetch in Console" function, the header will automatically be included and you still have the ability to change the headers and the body. The fetch API is a web standard and some introductory material about fetch can be found on MDN.
If you want to do custom requests, in the browser, fetch is a good option.
In other environments and languages you usually use some HTTP client (just search the web for "...your language... http request" or similar, you will find something).

API Proxy - Error while fetching object

When I open the details window on any of my API Proxies using the APIGee Developer Dashboard, I get two error messages
Error while fetching object: No server entry found with ID long token goes here
and
Server Error: No server entry found with ID same long token goes here
The page still seems to function partially, but this prevents me from seeing my API proxy deployments and proxy information, or from tracing calls to the API.
I can't figure out what triggered this error - I don't see any recent config changes and the API proxy and the endpoint services are up and running. There's no reference to 'Server Entry' anywhere on the config page or in the help, which makes it hard to know where to start when fixing this.
Please see here: http://status.apigee.com/
This could be related to the platform release in flight.
You can subscribe to this for future updates too.
If the issue still persists, do raise a support ticket http://apigee.com/about/support/request-support

ASIHttpRequest send a weired status code of zero. Not reaching the server

I use ASIHTTPRequest framework in my iPhone application to manage the HTTP communication. I followed their examples given in the project home page to send asynchronous requests. There we have to implement two callbacks, one for requestFinish and other for requestFailed.
However, 60% of the time requests sent by the iPhone ends up in the "requestFinish" callback method and gives a valid HTTP status code. But sometimes it goes to "requestFailed" callback and the status code become '0' which is confusing.
My investigations revealed that the internet connection is ok, and I am sending the request to the correct URL, however no log messages found in server log.
So why does the request gets dropped in the middle so randomly? Has anyone came across with this type of issue. Will be very helpful.
Thanks
Are you looking at the status code of the ASIHTTPRequest object? That code is simply an HTTP response code - if you didn't get a response, then that should be zero.
Instead, you want to look at the NSError object that the delegate failure callback gives you.
I would use something like:
NSLog(#"%#",[error localizedErrorDescription]);
To print out to the log what the error is. Of course, "error" is the name of the variable in the method signature - you should double-check that, I think that's what the default is.
In [ASHTTPRequest initialize], I changed
[sharedQueue setMaxConcurrentOperationCount:4]
to
[sharedQueue setMaxConcurrentOperationCount:10]
This work for me, but I don't know why.
MORE:
I found this.
As well as what phooze suggested, there is logging in ASIHTTPRequestConfig.h that you can enable, that may provide a clue as to what is happening.

Resources