Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have to upload a csv file using HTTpRequest component.
The API has the following specification:
Body Params
ID of the survey to import responses into
A CSV file containing responses for import. [?]
I can mention the location of the csv in the "Post parameters from file" option. My csv contains headers and values.
How do I pass the survey ID ? since it is not in the query parameter but in the Body Parameter?
Also, I tried using Postman. It shows success message, but I dont see the csv values in the API.
Please help me out
Do you happen to have an example job or a screenshot explaining how to change it to bitarray?
This seems to be a similar example as mine and the reason which I find this is not working is because its not able to send the body of the request. Hence 400 error.
I converted a file to a byte array by reading it using the tFileInputRaw and specifying byte array as the the read type. It will be returned as an Object, but you would just need to cast to a bytearray using a tConvertType.
Having said that, I am not entirely sure that would suit you. Did you try the link I sent you? That should work for you as you have total control over the code. Alternatively, did you try switching the "use cache to save the resource" on? Did that get rid of the defaultfilename.txt issue?
I did try the code snippet it throws 500 error while retrieving the data.
Response{protocol=http/1.1, code=500, message=Internal Server Error.
A basic question- can https request be made over http client?
can I send a file with content type - application/x-www-form-urlencoded?
Because thats exactly what i am using in postman and its succeeding whereas in the code its not.
A 500 error is an internal server error. It is unlikely to be caused by how you called it....unless the server's error messages are pretty poor. You need to pay attention to the errors you get.
If you have it working using one tool you have to copy exactly how you did it with that tool in Talend. You have several components to work with. You have the tREST, tRestClient, tFileFetch or Java code to work with. You need to find a route that will allow you to exactly copy the way in which you have got it working elsewhere. By the way, you can use any content-type. Not all parameter options are offered to developers using drop downs. Sometimes you need to specify them using the parameter/header tables.
Hi,
I tried tFileFetch and it seemed to error out because my API has specification to pass the Id and payload in body. But in tFileFetch I was not able to send ID as body.
What worked for me is tSystem. I used curl command and it worked file. I was able to upload the file.
Would you happen to share how were you able to accomplish this?
I used Curl command in tsystem to upload the file.