Use postman to send data to a apigee proxy - apigee

I want to post the following json data to apigee proxy.I created a apigee proxy with no target servers.
I copy the url from overview section in apigee and copied it into url in postman.I changed the verb in postman to Post.
I used the following apigee community post.
https://community.apigee.com/questions/54530/creating-an-api-proxy-for-
post-request.html
The data I post is { "age":30 }
When i click on the url it gives me response 200 .But in trace we can see the post action. I change postman header into Json(application/json)
But how do I check the data in my proxy?Next time I click on the url in overview section in apigee it shows me no data.

Try clicking on the individual steps in the Trace tool. There you can see the request payload that you're seeking.

Related

How to make a request to a URL with gRPC Transcoding Syntax with a standard POST request?

I am attempting to use the endpoint https://firestore.googleapis.com/v1/{parent=projects/*}/databases with more data needed per the documentation on Google's docs.
The goal is to be able to make this request with a standard http utility such as cURL.
I have attempted performing the request manually through the GUI with the Chrome network tab open, and I saw a request being made: https://firebasedatabase.clients6.google.com/v1beta/projects/XXXXXXXXXX/locations/us-central1/instances?databaseId=my-database&validateOnly=true&alt=json&key=secretkey
Per trial and error on another endpoint, I have found that the key parameter can be replaced with a Bearer Auth token in the header. Other than that I am at a dead end.

Web Api - httppost - The requested resource does not support http method Get after publish on production server

when i add profile of supplier on localhost working fine. and API POSt method is working fine.
but after publish of project on server getting 400 error when i add profile of supplier.
and in response getting this.
The requested resource does not support http method 'GET'.
with 400 status
i have attached images of errors.
Project url is :
https://localefood.maqssoft.com
test-user : supplier#gmail.com
password: a#123456A
This link has the same issue that i am looking for but not give the solution of problem.
https://forums.asp.net/t/2129791.aspx
enter image description here
Make a POST request with POSTMAN.
List item Use the same URL as you did for the GET request steps above, but now choose POST to be the selected HTTP method.
Click the Body tab just under the URL, then choose the raw radio
button and JSON (application/json) from the type dropdown menu:
You may note that a new Header gets automatically added to the
request. Requests that send data need a header telling the API what
kind of data is being sent. Click the Headers tab to see the
Content-Type: application/json header:
Click Send.
If you have recently submitted a request you may not be asked to
authenticate again. If you get an Unauthorized error, request a new
access token and click Send again.

How can I perform an HTTPS POST request that contains a file into the request body using CURL?

I have the following problem.
I have to perform a CURL HTTPS POST REQUEST that put a myFile.xml into the request body toward a specific URL (that shoul represent a web service endpoint), something like: https://XXX.YYY.ZZZ.WWW/myproject/xml/manager
How can I do it using CURL?
I need to do it to simulate a web service call to analyze the obtained request.

AWS API Gateway: Add header if response is Unauthorized

I setup an API Gateway in AWS that uses custom authorizers to implement an OAuth2 flow. It works fine. When the user is not authorized they get a 401 Authorized response. That is correct as well, but I would like to add a header that gives the client the endpoint where it can get the token. Something like AuthorizeUrl: url
How can I add this header to my response?
Unfortunately this isn't possible but it's on our backlog. I know it doesn't really make sense when the client gets a 401 but you can't tell them how to authorize.
I don't have an ETA to provide but I'll add a +1 to the feature request.
AWS added this functionality last year.
Refer to this
To do it manually:
Go to 'Response Headers' in API Gateway Console.
Choose Unauthorized (401)
Below 'Response Headers' add AuthorizeUrl and url
Save and deploy API to some stage.
To add this to Cloudformation, refer to this similar answer.
You can also add this to swagger, by adding this snippet(yaml):
x-amazon-apigateway-gateway-responses:
UNAUTHORIZED:
statusCode: 401
responseParameters:
gatewayresponse.header.AuthorizeUrl:"url"
responseTemplates:
application/json: "{\"message\":$context.error.messageString}"
In the API Gateway console go to the "Method Response" interface. You can add HTTP Status 401. In "Response Headers" add your custom "AuthorizeUrl" header. Then in the "Integration Response" interface you can add the value you'd like for that header.

How can I add custom JSON parameter in JIRA webhook?

I have a web-servise which listens to the JSON requests from different data sources. I want to identify data source by special parameter data-source. My question is how I can add field "data-source": "jira" to the webhook JSON body?
EDIT
For now my solution is to add to my webhook uri http://127.0.0.1:8080/DC data source parameter like this: http://127.0.0.1:8080/DC?data-source=jira, then check data source type and if it is equal to jira send request JSON body to method jiraJsonParser().
But I'm not sure if it is the best solution, isn't it?
I had a similar need, and solved the problem by creating a REST API with flask that acts as an aggregator/translator to accept requests from multiple tools, format the request as needed, and pass it on to it's intended target. For example, I have a Jira 'build request' ticket that sends a POST request via webhook to my API upon ticket creation. The API accepts the request, formats it as needed, fwd's the request on to Jenkins to run a build. As each part of the build runs, Jenkins sends requests back to the API, which get formatted as needed, and the original Jira ticket gets updated with the details/status of the build.
Here's a good article on building a REST API with flask - http://blog.luisrei.com/articles/flaskrest.html

Resources