Testing HTTP Hooks - http

I am building an API, one of its feature is the use of HTTP POST Hook calls triggered on particular actions.
Without taking the time to set a locale route to be the target of the POST call I was looking for an online service showing live POST to a given URL or some other way of testing POST hooks in my code.
Any advices ?

http://www.postbin.org/

You can manually create and test POST requests with Fiddler or the Poster Firefox addon

You can try HTTP request method same as POST,GET,PUT,DELETE at https://w3webtool.com/http-request-method with localhost (SEND BY CLIENT) and any host (SEND BY SERVER)

Related

send data to http endpoint using data fusion realtime pipeline

I'm creating a real-time data fusion pipeline where the Sink is a HTTP plugin call to Vertex AI endpoint in another GCP project. The request body will be provided by a previous step in the pipeline. The http sink plugin being used (HTTP v1.2.2) doesn't seem to support any oauth parameters. what is the best way to make that HTTP call with a dynamically generated token in the headers? any help is appreciated. Thank you
As of now, there is no way to achieve this. I also faced the same issue where my OAuth token expires in X days.
I've had to make a dynamic pipeline that doesn't fail so I have used a custom Argument setter and used the token(macro) that the custom args setter initializes in the HTTP plugin.
You can find the actual open-source code at the https://github.com/data-integrations/argument-setter

alamofire how to use taskWillPerformHTTPRedirection

i use alamofire to handle http request but receive nil
and the url has a server http redirect , how can i use taskWillPerformHTTPRedirection to allow perform http redirection .
then i can receive the result.
This is not something that is currently possible. Here's a detailed issue on the Github project site that walks through the problem. There are also two open pull requests, PR1 and PR2, that attempt to address this problem if you wish to work off a fork temporarily.

How do I tell my service (all calls REST/JSON) to handle OPTIONS requests?

I have written a WCF service to return JSON on REST requests. Works great with a browser hitting it. But when my JavaScript hits it, the first request is an OPTIONS request for the url with "Access-Control-Request-Method: GET".
I think I need to handle CORS as documented here. However the suggested code won't compile and the suggested web.config is illegal in places.
What do I need to do so the service will respond appropriately when asked if a GET can be requested on a url?
You may have to enable it in IIS as well: http://encosia.com/using-cors-to-access-asp-net-services-across-domains/

Go urlfetch.Transport.RoundTrip, can call in GET, but not POST?

I'm having a problem getting any response from urlfetch.Transport.RoundTrip in GAE Go. When I browse a page that makes the call in a browser, the call is executed as intended. When the same function is called from a POST request made by poclbm Bitcoin miner, I can't get a response.
The call is made by this package I made at line 77.
Is it possible, that in Google App Engine one can request data from other web pages under a HTTP GET, but not POST, or is there something else that can be causing this problem?
You can do POST request from App Engine using http.Client.Post, just make sure you create the http client with urlfetch.Client function.

Is there any way to check if a POST url exists?

Is there any way to determine if a POST endpoint exists without actually sending a POST request?
For GET endpoints, it's not problem to check for 404s, but I'd like to check POST endpoints without triggering whatever action resides on the remote url.
Sending an OPTIONS request may work
It may not be implemented widely but the standard way to do this is via the OPTIONS verb.
WARNING: This should be idempotent but a non-compliant server may do very bad things
OPTIONS
Returns the HTTP methods that the server supports for specified URL. This can be used to check the functionality of a web server by requesting '*' instead of a specific resource.
More information here
This is not possible by definition.
The URL that you're posting to could be run by anything, and there is no requirement that the server behave consistently.
The best you could do is to send a GET and see what happens; however, this will result in both false positives and false negatives.
You could send a HEAD request, if the server you are calling support it - the response will typically be way smaller than a GET.
Does endpoint = script? It was a little confusing.
I would first point out, why would you be POSTing somewhere if it doesn't exist? It seems a little silly?
Anyway, if there is really some element of uncertainty with your POST URL, you can use cURL, then set the header option in the cURL response. I would suggest that if you do this that you save all validated POSTs if its likely that the POST url would be used again.
You can send your entire POST at the same time as doing the CURL then check to see if its errored out.
I think you probably answered this question yourself in your tags of your question with cURL.

Resources