使用filemaker 16 cURL无法使用多部分/混合HTTP请求

时间:2017-09-23 19:26:55

标签: curl calendar batch-processing filemaker

根据Google日历API,批量请求的格式为:

POST /batch
Host: www.googleapis.com
Authorization: *accesstoken*
Content-Type: multipart/mixed; boundary=batch_foobarbaz

--batch_foobarbaz
Content-Type: application/http
Content-ID: <item1:x@barnyard.example.com>

GET /calendar/v3/calendars/calendarId/events/eventId
--batch_foobarbaz--

当我尝试使用Filemaker 16从URL插入时,我设置了以下参数

网址参数设置为:     &#34; https://www.googleapis.com/batch&#34;

虽然cURL选项设置为:

    "-X POST -H \"Content-Type: multipart/mixed; boundary=batch_foobarbaz\" 
-H \"Authorization: *accesstoken*\" 
-H \"Content-Length: *length*\" 
--data \"--batch_foobarbaz 
Content-Type: application/http 
Content-ID: <item1:x@barnyard.example.com>  
GET https://www.googleapis.com/calendar/v3/calendars/*CalendarId*/events/*EventId*  
--batch_foobarbaz--\""

我总是收到回应BAD REQUEST回复

编辑:

使用ascii dump我可以看到我的请求标题和正文发送为:

=> Send header, 354 bytes (0x162)
0000: POST /batch HTTP/1.1
0016: Host: www.googleapis.com
0030: User-Agent: FileMaker/16.0
004c: Accept: */*
0059: Accept-Encoding: deflate, gzip
0079: Content-Type: multipart/mixed; boundary=batch_foobarbaz
00b2: Authorization: Bearer ya29.GlvQBKcXsIPwA-k62TdRr04L7HC4LPto3_gB2
00f2: ZMOb48V3KVFZdJAX-13qTJ4jnvqXa4tcVnsJ6Vwi9PaJqhvKN8P5KWHYhQ-KJzog
0132: dTuwqxKF1v43fCZ2Nnhh6UD
014b: Content-Length: 226
0160:
=> Send data, 226 bytes (0xe2)
0000: --batch_foobarbaz  Content-Type: application/http Content-ID: <i
0040: tem1:x@barnyard.example.com> GET /calendar/v3/calendars/afo5kco9
0080: vcdn688s994o3l88q0@group.calendar.google.com/events/llmvkgqicq7b
00c0: d7hu5svpi6qea0 --batch_foobarbaz--
== Info: upload completely sent off: 226 out of 226 bytes

我做错了什么?

0 个答案:

没有答案