I followed this link provided by Microsoft Azure to import a Function App within Api Management. I achieved to import my function and to test it by sending a Http Request (method GET), I got a Http Response with a code 200 OK. However, there is no content (content-length: 0) but it has to return a json string in the body. It seems that the function app is not invoked. This is something I checked when I test individually my function app.
Do you have an idea why there is no content ?
Thanks
Related
i got a issue so i wrote this in my code this is the controller :
on my service i call like sdk to hit external API and i need to get the result of the response from that external API
on my sdk i use Axios like this :
i tried to execute but the response is always return when the status on my API already returned
My question is How to waiting the response from external API like my case ?
I have a service that shares html to multiple client web sites. I need to know The URL of where the request is coming from.
The client will add a custom script to their website and the script will load Firebase SDK and call one of my callable firebase functions.
exports.testFunction = functions.https.onCall(async (data, context) => {
//How do you access the requesting URL?
console.log(context.rawRequest.originalUrl) "/"
console.log(context.rawRequest.url) "/"
})
Thank you,
HTTP requests to callable functions don't really come "from" a URL. They come from anywhere on the internet. It could be a web site, Android or iOS app, or someone who simply knows the protocol to call the function.
If you're building a web app and you want to pass along the URL of the page making the request, you'll have to add that data into the object that the client passes to the function, which shows up in data.
When we try to run the UDP and Bandwidth tests from the given sample code, it tries to hit a Google API service URL (using ajax call) which looks like "https://networktraversal.googleapis.com/v1alpha/iceconfig?key=".
This service URL needs to be appended with an API_KEY before making an ajax call.
When I tried to run this example https://test.webrtc.org/
It is appending API_KEY to the Base_URL and making an ajax call (POST call) to get some data.
The tests are initiated based on the response data.
Base_URL: "https://networktraversal.googleapis.com/v1alpha/iceconfig?key="
API_KEY: "AIzaSyDX4ctY_VWUm7lDdO6i_-bx7J-CDkxS16I"
Service URL looks like this: "https://networktraversal.googleapis.com/v1alpha/iceconfig?key=AIzaSyDX4ctY_VWUm7lDdO6i_-bx7J-CDkxS16I"
This service gives the response.
All the tests like UDP, Bandwith etc are performed based on the "response.iceServers" Array.
When I tried to hit this service using the same API_KEY from the example, it is throwing an error "Invalid API_KEY from the request URL." So here to access this data we need to have an API_KEY.
Can someone please tell me what API_KEY is this and which one should I use??
Regards.
How to get HttpRequestContext when I am using Self Hosted Owin?
My class is being called by ApplicationInsights and not by a controller, so I don't have access to any context.
Is there any way similar to what we do using HttpContext?
There is no static class to retrieve the request when using OWIN self hosted, because you are essentially in a console application, which is unaware that you wrote code that receives http requests.
Owin is a pipeline. The request is passed from middleware to middleware by calling the next middleware with a context parameter containing the request (and the response for that matter).
Each middleware registered in the pipeline can inspect the request on the way in, in their registration order, and call the next middleware before processing the response.
It is very easy to write your own middleware, register it in the pipeline, and inspect the request object for each request coming in.
Take a look here if you need a quick code example : http://benfoster.io/blog/how-to-write-owin-middleware-in-5-different-steps
I built an API using AWS API Gateway and Lambda, now I am writing end to end tests, I am using Promise from bluebird and request, so I promisified request like this:
Promise.promisifyAll(require('request'));
Promise.promisifyAll(request);
Now when I make requests (POST, PUT, GET), using request.methodAsync, the method is not recognized by the API Gateway !
I launched Jasmine with :
NODE_DEBUG=request jasmine
I can see the method = 'POST' or whatever, but the API still not recognize the method of the requests I am making with the promisified request ! any one run into this situation ?
Hi I'm from the Api Gateway team. As long as the request is sent to a valid resource path / HTTP method pair on a deployed API, Api Gateway will accept it. Please note you'll need to put the stage name as the first path part in the URI (see example in the Api Gateway console on the Stages page).
If you're invoking the right API resource, the issue sounds like a client-side bug.
Jack