> Out of curiosity, what do your line endings look line in your manually
> constructed post stream?
>
> Each http header line should end with the hex characters 0x0d and 0x0a
> and the final header should end with 0x0d 0x0a 0x0d 0x0a. Chances are
> if your http headers aren't terminated correctly, flickr will never
> see your content, including the api_key...
I should have added that in C (or C++), the header lines should end with "\r\n" and the final header line should end with "\r\n\r\n".
Also, while developing my C++ flickr library, I wrote a routine to dump the data that was being sent/received in the following format, which has proven to be a huge aid in debugging:
2008-10-09 23:56:36 header sent, len=180
Offset Printable Hex Text
-------- ----------------------------------------------- ------------------
00000000 50 4f 53 54 20 2f 73 65 72 76 69 63 65 73 2f 75 |POST /services/u|
00000016 70 6c 6f 61 64 2f 20 48 54 54 50 2f 31 2e 31 0d |pload/ HTTP/1.1.|
00000032 0a 48 6f 73 74 3a 20 61 70 69 2e 66 6c 69 63 6b |.Host: api.flick|
00000048 72 2e 63 6f 6d 0d 0a 41 63 63 65 70 74 3a 20 2a |r.com..Accept: *|
00000064 2f 2a 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 |/*..Content-Leng|
00000080 74 68 3a 20 36 33 31 38 32 33 0d 0a 43 6f 6e 74 |th: 631823..Cont|
00000096 65 6e 74 2d 54 79 70 65 3a 20 6d 75 6c 74 69 70 |ent-Type: multip|
00000112 61 72 74 2f 66 6f 72 6d 2d 64 61 74 61 3b 20 62 |art/form-data; b|
00000128 6f 75 6e 64 61 72 79 3d 2d 2d 2d 2d 2d 2d 2d 2d |oundary=--------|
00000144 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------|
00000160 2d 2d 2d 2d 33 64 35 39 36 33 66 32 35 37 65 36 |----3d5963f257e6|
00000176 0d 0a 0d 0a |.... |
-------- ----------------------------------------------- ------------------
2008-10-09 23:56:36 data sent, len=1213
Offset Printable Hex Text
-------- ----------------------------------------------- ------------------
00000000 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------|
00000016 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 33 64 |--------------3d|
00000032 35 39 36 33 66 32 35 37 65 36 0d 0a 43 6f 6e 74 |5963f257e6..Cont|
00000048 65 6e 74 2d 44 69 73 70 6f 73 69 74 69 6f 6e 3a |ent-Disposition:|
00000064 20 66 6f 72 6d 2d 64 61 74 61 3b 20 6e 61 6d 65 | form-data; name|
00000080 3d 22 61 70 69 5f 6b 65 79 22 0d 0a 0d 0a XX XX |="api_key"....XX|
00000096 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX |XXXXXXXXXXXXXXXX|
00000112 XX XX XX XX XX XX XX XX XX XX XX XX XX XX 0d 0a |XXXXXXXXXXXXXX..|
I X'd out my api_key in the above, but you can see the way the headers were constructed and the first post data item, which is the api_key.Hope that helps,
jthomps