Linkedin Share Api using simple curl - api

I do a simple request to share something on my linkedin profile
I try to just do it with curl but it doesn't work
I set the content-type to JSON in the header and I also set the authorization in the header
curl -v -H 'Authorization: OAuth oauth_consumer_key="V9uKPtEEB7JxQvYzbR2DuDfLe4qXjASgP5UhPJp8k13CYgSnN3BRFILxUJ6ApuCH",oauth_token="d6af5cda-b46e-4c38-b566-11428a9584fc",oauth_signature_method="HMAC-SHA1",oauth_signature="1PofnBExFc7pMB8b08fV34B5sTg%3D",oauth_timestamp="1323544645",oauth_nonce="516e0a1eadda4c24bfbcc4ca5e0cbedc",oauth_version="1.0"' -H 'Content-Type: application/json' -X POST -d '{"recipients":{"values": [{"person":{"_path": "/people/~"}}]}, "subject": "JSON POST test", "body": "You rule"}' http://api.linkedin.com/v1/people/~/shares
When I post this I get this result
About to connect() to api.linkedin.com port 80 (#0)
* Trying 216.52.242.83... connected
* Connected to api.linkedin.com (216.52.242.83) port 80 (#0)
> POST /v1/people/ICshCGDT79/shares HTTP/1.1
> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: api.linkedin.com
> Accept: */*
> Authorization: OAuth oauth_consumer_key="V9uKPtEEB7JxQvYzbR2DuDfLe4qXjASgP5UhPJp8k13CYgSnN3BRFILxUJ6ApuCH",oauth_token="d6af5cda-b46e-4c38-b566-11428a9584fc",oauth_signature_method="HMAC-SHA1",oauth_signature="1PofnBExFc7pMB8b08fV34B5sTg%3D",oauth_timestamp="1323544645",oauth_nonce="516e0a1eadda4c24bfbcc4ca5e0cbedc",oauth_version="1.0"
> Content-Type: application/json
> Content-Length: 120
>
< HTTP/1.1 401 Unauthorized
< Server: Apache-Coyote/1.1
< Date: Sat, 10 Dec 2011 19:17:14 GMT
< Vary: *
< x-li-format: xml
< Content-Type: text/xml;charset=UTF-8
< Content-Length: 393
<
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<status>401</status>
<timestamp>1323544635447</timestamp>
<request-id>9UR4KT2T5Z</request-id>
<error-code>0</error-code>
<message>[unauthorized]. OAU:V9uKPtEEB7JxQvYzbR2DuDfLe4qXjASgP5UhPJp8k13CYgSnN3BRFILxUJ6ApuCH|d6af5cda-b46e-4c38-b566-11428a9584fc|*01|*01:1323544645:1PofnBExFc7pMB8b08fV34B5sTg=</message>
</error>
* Connection #0 to host api.linkedin.com left intact
* Closing connection #0
Anyone can tell me where am I wrong?
Thanks,

Related

How can I upload via curl to an S3 presigned url using the v3 api?

I'm trying to use the v3 api to create a pre signed url for uploading. I am able to use this config to access other parts of the api just fine.
I'm running minio in a docker container and my code is running in another container.
Below is how I'm generating a presigned url:
import { PutObjectCommand, S3, S3Client } from "#aws-sdk/client-s3"
import { getSignedUrl } from "#aws-sdk/s3-request-presigner"
const config = {
endpoint: "http://minio:9000",
forcePathStyle: true,
region: 'us-east-1',
credentials: {
accessKeyId: '...',
secretAccessKey: '...',
}
}
const client = new S3Client(config)
const command = new PutObjectCommand({
Bucket: 'uploads',
Key: 'test123',
});
const url = await getSignedUrl(this.client, command, { expiresIn: 3600 });
And then that produces a url such as:
http://minio:9000/uploads/test123?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AjAOk2gNRU%2F20210727%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210727T182833Z&X-Amz-Expires=3600&X-Amz-Signature=3e7407384dd87e2715d3daa2c58e53e1bfb619ec0b495009558fbe3094add5ef&X-Amz-SignedHeaders=host&x-id=PutObject
I swap minio:9000 to localhost but set the Host to minio then make the request via curl like so:
curl -H "Host: minio:9000" -X PUT "$URL" --upload-file ~/Desktop/hello.txt -v
Its giving me this error:
The request signature we calculated does not match the signature you provided. Check your key and signing method.
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> PUT /uploads/test123?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AjAOk2gNRU%2F20210727%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210727T184545Z&X-Amz-Expires=3600&X-Amz-Signature=44058eebea8e31afb60a5993f9d26b644c40bebda24004b63225a51d227e7723&X-Amz-SignedHeaders=host&x-id=PutObject HTTP/1.1
> Host: minio:9000
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 252
> Expect: 100-continue
>
< HTTP/1.1 403 Forbidden
< Accept-Ranges: bytes
< Content-Length: 399
< Content-Security-Policy: block-all-mixed-content
< Content-Type: application/xml
< Server: MinIO
< Vary: Origin
< X-Amz-Request-Id: 1695BA2F941F436A
< X-Xss-Protection: 1; mode=block
< Date: Tue, 27 Jul 2021 18:45:53 GMT
< Connection: close
<
<?xml version="1.0" encoding="UTF-8"?>
* Closing connection 0
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Key>test123</Key><BucketName>uploads</BucketName><Resource>/uploads/test123</Resource><RequestId>1695BA2F941F436A</RequestId><HostId>fb52d19a-7b70-4620-9a52-726ba6fd9df5</HostId></Error>
I've tried sending more or less headers via curl it seems to have no effect. I dont' know why it thinks the signatures don't match either.
the signature is generated using the parameters this.client, command, { expiresIn: 3600 }, this.client includes S3Client(config), config includes endpoint: "http://minio:9000" and you are modifying the endpoint after the signature is generated thereby invalidating the signature, as the error suggests.

my request failed when the post 'content-type' is application/x-www-form-urlencoded and * form field param= { <this is a json object>}

The request is failed when I post request an API whose header content-type is 'application/x-www-form-urlencoded; charset=UTF-8' and post body is ' param = { this is a json object} '
The curl request like this, it works.
curl 'http://localhost:7272/Acme/iEhr/PersonSample' -H 'Cookie: ACMETMP=fe35925f-a243-4be9-8e73-60c461ef9bd3; JSESSIONID=47A43F4988F232CC7B53F6CF30B954F6; SESSION=e580c2c7-bf4b-45e6-93fc-de6f79854346' -H 'Origin: http://localhost:7272' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: zh-CN,zh;q=0.9' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, /; q=0.01' -H 'Referer: http://localhost:7272/route/sampleadd' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'param=%7B%22cityid%22%3A%222091afc3-bcd6-46d9-8033-3548ad10933b%22%2C%22areaid%22%3A%222d09f5e5-a07d-445c-9d8a-51eb436699a8%22%2C%22hosid%22%3A%220f226b63-58ad-44d7-bf23-25d0345276e1%22%2C%22deptid%22%3A%2291c176f5-63ca-4b95-87c4-9f311864ff9b%22%2C%22barcode%22%3A%221000000000%22%2C ......' --compressed
it also works with postman request but failed with Karate
Scenario: 样本登记
Given path 'iEhr/PersonSample'
And header Content-type = 'application/x-www-form-urlencoded; charset=UTF-8'
* cookies { JSESSIONID: '#(jsessionID)',SESSION: '#(sessionID)', ACMETMP: '#(acmetmpID)'}
And form fields param = {"cityid":"2091afc3-bcd6-46d9-8033-3548ad10933b","areaid":"2d09f5e5-a07d-445c-9d8a-51eb436699a8","hosid":"0f226b63-58ad-44d7-bf23-25d0345276e1","deptid":"91c176f5-63ca-4b95-87c4-9f311864ff9b","barcode":"1000000000","mothername":"manual-mother1","pregweek":"21", and so on}
When method post
Then status 200
* print response
'And form fields param = {this is a json object}'
this sentence should work but failed for us.
What is my means by karate failed ?
The response code is different compared with Karate, and it is expected result when working with postman.
Postman
the necessary param data
Karate:
18:14:09.437 request:
1 > POST http://localhost:7272/Acme/iEhr/PersonSample
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Content-Length: 899
1 > Content-Type: application/x-www-form-urlencoded; charset=UTF-8
1 > Cookie: ACMETMP=d22c0d9a-b98b-4f6f-9e42-2f9bdffa22c8; JSESSIONID=09268B9F4CA0C15AE3FFB1A26BE424ED; SESSION=2baafdac-38d6-43d0-ac5c-d39e2b29fa48
1 > Host: localhost:7272
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_211)
cityid=2091afc3-bcd6-46d9-8033-3548ad10933b&areaid=2d09f5e5-a07d-445c-9d8a-51eb436699a8&hosid=0f226b63-58ad-44d7-bf23-25d0345276e1&deptid=91c176f5-63ca-4b95-87c4-9f311864ff9b&barcode=1000000000&mothername=manual-mother1&pregweek=21&pregday=1&midentitycard=&birthday=2018-10-01+00%3A00&collectdate=2019-05-15+14%3A38&personsex=1&personweight=4000&address=manual-testaddress1&mobile=15397006044&collectperson=&samplequality=1&borntype=1&linkman=&fidentitycard=&labitem=PHE&sampletype=1&btn=&isfee=0&personremark=&telephone=&bednumber=&labstring=&collectnumber=&freecode=&dhosid=0f226b63-58ad-44d7-bf23-25d0345276e1&reviewtype=&diagnosticstatus=&centerid=bb717701-10de-47ee-b49e-693261c6df22&nowdeptid=07eeec75-079b-4fa9-93cf-c45ddc9a87b9&operator=%E9%BB%84%E5%86%88%E5%B8%82%E5%A6%87%E5%B9%BC%E4%BF%9D%E5%81%A5%E9%99%A2&labitems=PHE&pagecode=sampleadd&modifydetail=%E6%A0%B7%E6%9C%AC%E5%BD%95%E5%85%A5
18:14:09.557 response time in milliseconds: 120.12
1 < 200
1 < Accept-Charset: big5, big5-hkscs, cesu-8, euc-jp, euc-kr, gb18030, gb2312, gbk, ibm-thai ...... and so on
1 < Content-Length: 52
1 < Content-Type: text/plain;charset=UTF-8
1 < Date: Wed, 15 May 2019 10:14:09 GMT
1 < X-Application-Context: Acme.jc.test:dev:7272
[{"code":-90018,"result":"(错误-90018)失败!"}]
Can you try this,
Scenario: 样本登记
Given path 'iEhr/PersonSample'
* cookies { JSESSIONID: '#(jsessionID)',SESSION: '#(sessionID)', ACMETMP: '#(acmetmpID)'}
And def ffParams = {"param" : {"cityid":"2091afc3-bcd6-46d9-8033-3548ad10933b","areaid":"2d09f5e5-a07d-445c-9d8a-51eb436699a8","hosid":"0f226b63-58ad-44d7-bf23-25d0345276e1","deptid":"91c176f5-63ca-4b95-87c4-9f311864ff9b","barcode":"1000000000","mothername":"manual-mother1","pregweek":"21"}}
And form fields ffParams
When method post
Then status 200
* print response
Form fields are by default url-encoded only no need to explicitly mention it in header
And form field param = {"cityid":"2091afc3-bcd6-46d9-8033-3548ad10933b","areaid":"2d09f5e5-a07d-445c-9d8a-51eb436699a8","hosid":"0f226b63-58ad-44d7-bf23-25d0345276e1","deptid":"91c176f5-63ca-4b95-87c4-9f311864ff9b","barcode":"1000000000","mothername":"manual-mother1","pregweek":"21","pregday":"1","midentitycard":"","birthday":"2018-10-01 00:00" ...... and so on }
I changed to this, it works now.
I am misled by the keyword 'param' in karate and the keyword 'param' used by our product code.

Why POST endpoint not being invoked but GET endpoint is being invoked - jersey container grizzly2

I can't figure out why my GET endpoint gets called but my POST endpoint is not working. When I call curl -v -X GET http://localhost:8080/myresource/test123 it succesfully returns hello
But when I call
curl -v -X POST \
http://localhost:8080/myresource \
-H 'Content-Type: application/json' \
-d '{"test": "testvalue"}'
I keep getting this response:
* Connected to localhost (::1) port 8080 (#0)
> POST /myresource HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 21
>
* upload completely sent off: 21 out of 21 bytes
< HTTP/1.1 500 Request failed.
< Content-Type: text/html;charset=ISO-8859-1
< Connection: close
< Content-Length: 1031
<
* Closing connection 0
<html><head><title>Grizzly 2.4.0</title><style><!--div.header {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#003300;font-size:22px;-moz-border-radius-topleft: 10px;border-top-left-radius: 10px;-moz-border-radius-topright: 10px;border-top-right-radius: 10px;padding-left: 5px}div.body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:#FFFFCC;font-size:16px;padding-top:10px;padding-bottom:10px;padding-left:10px}div.footer {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#666633;font-size:14px;-moz-border-radius-bottomleft: 10px;border-bottom-left-radius: 10px;-moz-border-radius-bottomright: 10px;border-bottom-right-radius: 10px;padding-left: 5px}BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}B {font-family:Tahoma,Arial,sans-serif;color:black;}A {color : black;}HR {color : #999966;}--></style> </head><body><div class="header">Request failed.</div><div class="body">Request failed.</div><div class="footer">Grizzly 2.4.0</div></body></html>%
Here is my code
import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.ws.rs.core.Response
#Path("myresource")
class HelloWorldResource {
#POST
#Consumes(MediaType.APPLICATION_JSON)
#Produces(MediaType.APPLICATION_JSON)
fun createMessage(testPost: String): Response {
return Response.status(200).entity("helllo post").build()
}
#GET
#Path("{testGet}")
#Produces(MediaType.APPLICATION_JSON)
fun getMessage(#PathParam("testGet") testGet: String): Response {
return Response.status(200).entity("hello").build()
}
}
Without seeing the actual underlying exception, it's hard to say for sure, but likely you're running into similar issues as Jersey: Return a list of strings with mismatches between a String type and a MediaType.APPLICATION_JSON produces/consumes declarations. If you're dealing in raw strings, I'd suggest using MediaType.PLAIN_TEXT, or having your post body and return value be an entity that can be represented as a non-raw-string json object (ie, something enclosed in {}), and making sure a jackson provider is registered with jersey.

Reading an ActiveMQ Topic using cURL - Getting message bodies

I'm trying to debug some JMS code by running an ActiveMQ locally - Using the Docker image rmohr/activemq:5.15.4-alpine - and using cURL to read the messages posted to the topic. This is mostly working, but I'm not getting the actual body of the message.
What I'm doing is:
curl -v -XGET http://admin:admin#localhost:8161/api/message?destination=topic://Events&json=true&oneShot=true
And this works as follows:
> GET /api/message?destination=topic://Events&json=true&oneShot=true HTTP/1.1
> Host: localhost:8161
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 20 Nov 2018 17:09:03 GMT
< X-FRAME-OPTIONS: SAMEORIGIN
< Set-Cookie: JSESSIONID=mcjaka6dsuz6534j0gj0gfnv;Path=/api
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1
< destination: topic://Events
< id: ID:b8b750274409-46243-1542707161912-1:23:1:1:6
< eventTime$iso8601: 2018-11-20T17:09:13.216Z
< eventTime$millis: 1542733753216
< eventName: ProcessItemEvent
< Transfer-Encoding: chunked
< Server: Jetty(9.2.22.v20170606)
<
However, the actual payload of the message is not returned. If I take off the json=true&oneShot=true then I get this instead:
{ [5 bytes data]
But still no more than that. And there should be a lot more than 5 bytes of payload data for these messages.
What am I missing in getting these messages to come through correctly?
Cheers
You are subscribing to topic://Events . Could it be that all the event information is in the header of the http response, and ActiveMQ is not adding anything extra in the body?
< destination: topic://Events
< id: ID:b8b750274409-46243-1542707161912-1:23:1:1:6
< eventTime$iso8601: 2018-11-20T17:09:13.216Z
< eventTime$millis: 1542733753216
< eventName: ProcessItemEven
If you want the messages posted to a specific topic, say 'foo.bar' you need to subscribe to topic://foo.bar .
I tried your command. As you can see below, I am getting the message body.
Could it be that you are receiving binary data that is not displaying in the terminal? Can you try saving the message body to a file. e.g. curl -o body.dat -v -XGET ...
$ curl -v -XGET 'http://admin:admin#localhost:8161/api/message?destination=topic://bayCarrState'
> GET /api/message?destination=topic://bayCarrState HTTP/1.1
> Authorization: Basic YWRtaW46YnJva2VyYWRtaW4=
> User-Agent: curl/7.29.0
> Host: localhost:8161
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Fri, 23 Nov 2018 04:55:59 GMT
< X-FRAME-OPTIONS: SAMEORIGIN
< Set-Cookie: JSESSIONID=sbwv48hmp5w9zw4zgttrbmyn;Path=/api
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Content-Type: text/plain; charset=ISO-8859-1
< destination: topic://bayCarrState
< id: ID:prd-rh7.mirrabooka.local-40596-1541746708502-3:160:-1:1:105
< Transfer-Encoding: chunked
< Server: Jetty(9.2.22.v20170606)
<
[{"elemId":"BayCarrState1","elemType":"BayCarrState","elemValue":{"bayId":"1","binFullWt":0,"binTipng":0,"binUntipdWt":0,"continuableRailSam
":0,"delivType":"R","frontPos":14,"lastSamTipng":0,"lastTickTipng":0,"locNum":1,"milltrainId":"A","rearPos":1,"samInProgress":0,"samTipng":0
,"tickTipng":0,"tipInProgress":0,"tipReady":0},"version":294},{"elemId":"BayCarrState2","elemType":"BayCarrState","elemValue":{"bayId":"2","
binFullWt":0,"binTipng":0,"binUntipdWt":0,"continuableRailSam":0,"delivType":"T","frontPos":28,"lastSamTipng":0,"lastTickTipng":0,"locNum":1
,"milltrainId":"A","rearPos":15,"samInProgress":0,"samTipng":0,"tickTipng":0,"tipInProgress":0,"tipReady":0},"version":294}]
* Connection #0 to host localhost left intact

Set a GPS property via API for Olympus Air

I am trying to add GPS tag to each photo using the Olympus Air and the API.
But i can't even set the GPS on.( I am on record mode ) The camera is not responding to the command.
I tried a POST with:
http://192.168.0.10/set_camprop.cgi?com=setlist
Headers
Content-type: text/xml
User-Agent: OlympusCameraKit
Content-Length: 74
Host: 192.168.0.10
Connection: Keep-Alive
Body
<?xml version="1.0"?><set><prop name="GPS"><value>ON</value></prop>
</set>
My shell script works correctly on macOS.
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/get_connectmode.cgi'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/switch_commpath.cgi?path=wifi'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/start_pushevent.cgi?port=65000'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/switch_cameramode.cgi?mode=standalone'
sleep 2
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/switch_cameramode.cgi?mode=rec&lvqt=0320x0240'
sleep 2
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/exec_takemisc.cgi?com=startliveview&port=5555'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/get_state.cgi'
echo
echo
curl -v \
-H 'Content-type: text/xml' \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
-d '<?xml version="1.0"?><set><prop name="GPS"><value>ON</value></prop></set>' \
'http://192.168.0.10/set_camprop.cgi?com=setlist'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/get_camprop.cgi?com=get&propname=GPS'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/switch_cameramode.cgi?mode=standalone'
sleep 2
echo
echo
A result is following:
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_connectmode.cgi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 55
< Connection: close
<
<?xml version="1.0"?>
<connectmode>OPC</connectmode>
* Curl_http_done: called premature == 0
* Closing connection 0
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_commpath.cgi?path=wifi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Length: 0
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /start_pushevent.cgi?port=65000 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: www/unknown
< Content-Length: 0
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=standalone HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=rec&lvqt=0320x0240 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /exec_takemisc.cgi?com=startliveview&port=5555 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 405
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><funcidlist><funcid name="framesize"/><funcid name="afframeinfo"/><funcid name="mntmediainfo"/><funcid name="rotation"/><funcid name="maxtakenum"/><funcid name="shutspeedvalue"/><funcid name="focalvalue"/><funcid name="expcomp"/><funcid name="isospeedvalue"/><funcid name="expphotowarning"/><funcid name="focusinfo"/><funcid name="zoominfo"/><funcid name="maxmovietime"/></funcidlist>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_state.cgi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 426
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><response><cardstatus>normal</cardstatus><cardremainnum>425</cardremainnum><cardremainsec>1123</cardremainsec><cardremainbyte>3709501440</cardremainbyte><lensmountstatus>normal</lensmountstatus><imagingstate>normal</imagingstate><focallength>14</focallength><widefocallength>14</widefocallength><telefocallength>42</telefocallength><electriczoom>OK</electriczoom><macrosetting>NG</macrosetting></response>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> POST /set_camprop.cgi?com=setlist HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> Content-type: text/xml
> User-Agent: OlympusCameraKit
> Content-Length: 73
>
* upload completely sent off: 73 out of 73 bytes
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 59
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><response><notset></notset></response>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_camprop.cgi?com=get&propname=GPS HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 49
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><get><value>ON</value></get>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=standalone HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>
I hope it will help you.