I have the fluentd plugin for Bigquery setup and it's been working really great when I use HTTP POST/GET to send JSON payload, but I wanted to try and switch to using Navigator.sendBeacon
The problem is that this API doesn't let me configure the type of payload and these are the ones supported:
A ArrayBuffer, ArrayBufferView, Blob, DOMString, FormData, or
URLSearchParams object containing the data to send.
So when using it as is it the plugin doesn't accept the request.
Is there any way to either explicitly state the payload is JSON or configure/alter the plugin to support the types mentioned above ?
Thanks!
Related
I am working on an application with graphQL and spring boot framework. Here I am using GraphQL's Schema-first approach to write my schema details. In my scenario, I need to update the user profile image using GraphQL. I am using my test client as postman and I have attached the mock request structure as well. When I send my mock data to the server, I am receiving '415 - Unsupported Media Type' error response. Can someone please guide me on this. ?
Also, please suggest if I have to use multipart file to get the uploaded file at the server.
Thanks in advance.
While posting form data in nativescript-angular, I am getting below error
originalStack: Error: java.net.ConnectException: Connection refused\n at new ZoneAwareError
can any one help me?
NativeScript's Http Client doesn't support FormData. You will have to either use JSON request Or use nativescript-http-formdata plugin to send data.
tns plugin add nativescript-http-formdata
Note: If you use the plugin, you would loose the luxury of using Angular's HttpClient & features like interceptors etc.,
How do I get request form-data as a string in API Connect? I tried to get it in Gateway script by different ways, like apim.getvariable('request.body') or session.input.readAsBuffer, but everything was unsuccessful. I have two attachments in form-data and I would like to split it in my script.
At the moment I haven't found any documentation about processing form-data in IBM API Connect.
If you are using a POST QueryString you can decode the URI component in your Gateway script using:
var myQueryString = decodeURIComponent(apim.getvariable('request.body').item(0).toBuffer().toString())
I have created an api in amazon api gateway service with s3 proxy, and created a method post to upload a file to s3 using the document. Deployed the API and then using that url i tried to call the api from postman. But i couldn't post the file and it returns an error 'missing authentication token'.
I set authorization as NONE.
Then it returns an Unexpected "<" error.
Ah, okay. S3 only supports POST from an HTML form, which is why you see the error where it is expecting multipart formdata.
The method you need to use is PUT, instead of POST. PUT requires an item path, so you'll need to change the resource path to have a bucket and key, or get those from other places.
I have some more info on how to set this up in upload binary from api gateway to S3 bucket
It sounds like the document you're uploading isn't JSON. By default, API Gateway expects UTF-8 encoded JSON.
What content type are you sending with your Postman request?
Can any please help me about how to make HTTP call using the PATCH method in an HTTP Adapter in IBM Worklight?
The PATCH method is not supported. Per the HTTP adapter documentation:
You can use the HTTP adapter to send GET, POST, PUT, and DELETE HTTP
requests and retrieve data from the response body. Data in the
response can arrive in XML, HTML, or JSON formats.
You can submit feature requests via: http://www.ibm.com/developerworks/rfe/