2017-09-12 1 views
1

次のカールコマンドをJitterbit操作に変換するにはどうすればよいですか?Jitterbit HTTP POST操作にcurl -F [email protected]{path/to/file.csvのようなファイルを添付するにはどうすればいいですか?

現在、私は私の運転のように構成されている
curl -i -u username:password -X POST -F [email protected]/path/to/file.csv 
https://website.com/api/filepost 

は次のとおりです。

enter image description here

  1. スクリプト:

    $ jitterbit.target.http.form_data = true; $ jitterbit.target.http.form_data.filename = "file.csv"; $ jitterbit.target.http.form_data.name = "file"; (カールを経由して成功した同じファイルを送っ)APIの仕様に合致する

  2. ソース ヘッダなしのCSVファイル、

  3. 変容:テキストへ テキスト - ソースとターゲットの両方が同じファイル形式を使用します現在のソースファイル

  4. APIエンドポイント enter image description here

I正常に認証されましたが、「No file attached」という400/Bad Requestのエラーメッセージが表示されます。

フルエラーメッセージ:

The operation "2. POST Preapplicants - CSV to API" failed. 

Fatal Error 
Failed to post to the url 'https://website.com/api/filepost’. 
The last (and probably most relevant) error was: The server 
returned HTTP Status Code : 400 Bad Request Error is: The 
request could not be processed by the server due to invalid 
syntax. Headers sent by the server: HTTP/1.1 400 Bad Request 
Server: nginx/1.10.3 (Ubuntu) Content-Type: application/json 
Transfer-Encoding: chunked Connection: keep-alive Cache-Control: 
no-cache Date: Tue, 12 Sep 2017 18:55:38 GMT The response was: 
{"message":"No file attached."} 

答えて

0

Iは、以下の操作を行って、この問題を解決: 1. 2(同じソース、ターゲット、およびスクリプトを使用して)アーカイブ操作に変換操作からの変更。私のHTTP接続のコンテンツタイプをmultipart/form-data(カールで渡されるデフォルトのコンテンツタイプ)に変更する

関連する問題