206 Partial Content does not accept data from server - http

I'm trying return video partially, using 206 Partial Content, I transfer all the headers correctly, but the request passes only 4kb, but if I answer 200 OK, the video will work, what could be the problem?
(If I answer 200 OK, then I can't rewind the video)
Type: Document
Request:
GET / HTTP/1.1
Host: 127.0.0.1:8080
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36
DNT: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: ru,en;q=0.9
Response:
HTTP/1.1 200 OK
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Mon, 11 Mar 2019 19:03:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Accept-Ranges: bytes
Content-Encoding: gzip
Content-Type: video/mp4; charset=utf-8
Date: Mon, 11 Mar 2019 19:03:02 GMT
Content-Length: 16766763
Keep-Alive: timeout=15,max=100
=============================================
Type: Media
Request:
GET / HTTP/1.1
Host: 127.0.0.1:8080
Connection: keep-alive
DNT: 1
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36
Accept: */*
Referer: http://127.0.0.1:8080/
Accept-Language: ru,en;q=0.9
Range: bytes=0-
Response:
HTTP/1.1 206 Partial Content
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Mon, 11 Mar 2019 19:03:02 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Accept-Ranges: bytes
Content-Type: video/mp4; charset=utf-8
Date: Mon, 11 Mar 2019 19:03:02 GMT
Keep-Alive: timeout=15,max=100
Content-Range: bytes 0-29593599/29593600
Content-Length: 29593600

The problem was in localhost, everything works on server, thanks :)

Related

Tileserver-gl with Varnish always giving Age: 0 for the pbf

I am using tileserver-gl and want to use Varnish to cache the tiles. Varnish is working with nginx, that is taking care of the SSL.
The pbf tiles return Age:0 in the header (and a MISS), while the Date and Expires headers keep their value between reloads. What am I doing wrong?
In nginx I am using the following parameters
expires 2d;
add_header Cache-Control "public, no-transform";
Here's my .vcl
sub vcl_recv {
unset req.http.cookie; #added as a test, nothing changed so don't know if I should keep it
}
sub vcl_backend_response {
}
sub vcl_deliver {
if (obj.hits > 0) { # Add debug header to see if it's a HIT/MISS and the number of hits
set resp.http.X-Cache = "HIT";
} else {
set resp.http.X-Cache = "MISS";
}
}
Here's response header for one of the pbf tiles. They all give similar results, with Age: 0
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Age: 0
Cache-Control: max-age=172800, public, no-transform
Content-Encoding: gzip
Content-Length: 44891
Content-Type: application/x-protobuf
Date: Fri, 09 Dec 2022 10:30:34 GMT
ETag: W/"af5b-yQTY5UUgiSJNWC0axguA5dmojbI"
Expires: Sun, 11 Dec 2022 10:30:34 GMT
Last-Modified: Wed, 23 Nov 2022 09:25:23 GMT
Server: nginx/1.18.0 (Ubuntu)
Vary: Accept-Encoding
Via: 1.1 varnish (Varnish/6.6)
X-Cache: MISS
X-Varnish: 557061
EDIT
Tried Thijs suggestion, here's the output
* << Request >> 98318
- Begin req 98317 rxreq
- Timestamp Start: 1670854870.784403 0.000000 0.000000
- Timestamp Req: 1670854870.784403 0.000000 0.000000
- VCL_use boot
- ReqStart 127.0.0.1 38402 a0
- ReqMethod GET
- ReqURL /data/2017-07-03_europe_italy/0/0/0.pbf
- ReqProtocol HTTP/1.0
- ReqHeader X-Forwarded-Host: tiles.urbismap.com
- ReqHeader X-Real_IP: 93.41.126.66
- ReqHeader X-Forwarded-For: 93.41.126.66
- ReqHeader X-Forwarded-Proto: https
- ReqHeader Host: tiles.urbismap.com
- ReqHeader Connection: close
- ReqHeader User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
- ReqHeader Accept: */*
- ReqHeader Sec-Fetch-Site: same-origin
- ReqHeader Sec-Fetch-Mode: cors
- ReqHeader Sec-Fetch-Dest: empty
- ReqHeader Referer: https://tiles.urbismap.com/styles/basemap/
- ReqHeader Accept-Encoding: gzip, deflate, br
- ReqHeader Accept-Language: it-IT,it;q=0.9
- ReqUnset X-Forwarded-For: 93.41.126.66
- ReqHeader X-Forwarded-For: 93.41.126.66, 127.0.0.1
- VCL_call RECV
- VCL_return hash
- ReqUnset Accept-Encoding: gzip, deflate, br
- ReqHeader Accept-Encoding: gzip
- VCL_call HASH
- VCL_return lookup
- VCL_call MISS
- VCL_return fetch
- Link bereq 98319 fetch
- Timestamp Fetch: 1670854870.792969 0.008566 0.008566
- RespProtocol HTTP/1.1
- RespStatus 200
- RespReason OK
- RespHeader Server: nginx/1.18.0 (Ubuntu)
- RespHeader Date: Mon, 12 Dec 2022 14:21:10 GMT
- RespHeader Content-Type: application/x-protobuf
- RespHeader Content-Length: 31578
- RespHeader Access-Control-Allow-Origin: *
- RespHeader Content-Encoding: gzip
- RespHeader Last-Modified: Wed, 23 Nov 2022 09:25:23 GMT
- RespHeader ETag: W/"7b5a-Lgi1EP0ZRDWVK1iX+VP47MXHk2M"
- RespHeader Expires: Wed, 14 Dec 2022 14:21:10 GMT
- RespHeader Cache-Control: max-age=172800, public, no-transform
- RespHeader Vary: Accept-Encoding
- RespHeader X-Varnish: 98318
- RespHeader Age: 0
- RespHeader Via: 1.1 varnish (Varnish/6.6)
- VCL_call DELIVER
- RespHeader X-Cache: MISS
- VCL_return deliver
- Timestamp Process: 1670854870.793004 0.008600 0.000034
- Filters
- RespHeader Accept-Ranges: bytes
- RespHeader Connection: close
- Timestamp Resp: 1670854870.794239 0.009835 0.001235
- ReqAcct 555 0 555 524 31578 32102
- End
** << BeReq >> 98319
-- Begin bereq 98318 fetch
-- VCL_use boot
-- Timestamp Start: 1670854870.784497 0.000000 0.000000
-- BereqMethod GET
-- BereqURL /data/2017-07-03_europe_italy/0/0/0.pbf
-- BereqProtocol HTTP/1.0
-- BereqHeader X-Forwarded-Host: tiles.urbismap.com
-- BereqHeader X-Real_IP: 93.41.126.66
-- BereqHeader X-Forwarded-Proto: https
-- BereqHeader Host: tiles.urbismap.com
-- BereqHeader User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
-- BereqHeader Accept: */*
-- BereqHeader Sec-Fetch-Site: same-origin
-- BereqHeader Sec-Fetch-Mode: cors
-- BereqHeader Sec-Fetch-Dest: empty
-- BereqHeader Referer: https://tiles.urbismap.com/styles/basemap/
-- BereqHeader Accept-Language: it-IT,it;q=0.9
-- BereqHeader X-Forwarded-For: 93.41.126.66, 127.0.0.1
-- BereqHeader Accept-Encoding: gzip
-- BereqProtocol HTTP/1.1
-- BereqHeader X-Varnish: 98319
-- VCL_call BACKEND_FETCH
-- VCL_return fetch
-- Timestamp Fetch: 1670854870.784543 0.000045 0.000045
-- Timestamp Connected: 1670854870.784548 0.000050 0.000005
-- BackendOpen 31 default 127.0.0.1 8080 127.0.0.1 41766 reuse
-- Timestamp Bereq: 1670854870.784608 0.000111 0.000060
-- Timestamp Beresp: 1670854870.792781 0.008283 0.008172
-- BerespProtocol HTTP/1.1
-- BerespStatus 200
-- BerespReason OK
-- BerespHeader Server: nginx/1.18.0 (Ubuntu)
-- BerespHeader Date: Mon, 12 Dec 2022 14:21:10 GMT
-- BerespHeader Content-Type: application/x-protobuf
-- BerespHeader Content-Length: 31578
-- BerespHeader Connection: keep-alive
-- BerespHeader Access-Control-Allow-Origin: *
-- BerespHeader Content-Encoding: gzip
-- BerespHeader Last-Modified: Wed, 23 Nov 2022 09:25:23 GMT
-- BerespHeader ETag: W/"7b5a-Lgi1EP0ZRDWVK1iX+VP47MXHk2M"
-- BerespHeader Expires: Wed, 14 Dec 2022 14:21:10 GMT
-- BerespHeader Cache-Control: max-age=172800
-- BerespHeader Cache-Control: public, no-transform
-- TTL RFC 172800 10 0 1670854871 1670854871 1670854870 1671027670 172800 cacheable
-- VCL_call BACKEND_RESPONSE
-- VCL_return deliver
-- Timestamp Process: 1670854870.792827 0.008329 0.000046
-- Filters testgunzip
-- BerespHeader Vary: Accept-Encoding
-- Storage malloc s0
-- Fetch_Body 3 length stream
-- Gzip u F - 31578 51339 80 141523 252560
-- BackendClose 31 default recycle
-- Timestamp BerespBody: 1670854870.794161 0.009664 0.001334
-- Length 31578
-- BereqAcct 552 0 552 426 31578 32004
-- End
* << Request >> 98350
- Begin req 98349 rxreq
- Timestamp Start: 1670855034.759301 0.000000 0.000000
- Timestamp Req: 1670855034.759301 0.000000 0.000000
- VCL_use boot
- ReqStart 127.0.0.1 47736 a0
- ReqMethod GET
- ReqURL /data/2017-07-03_europe_italy/0/0/0.pbf
- ReqProtocol HTTP/1.0
- ReqHeader X-Forwarded-Host: tiles.urbismap.com
- ReqHeader X-Real_IP: 93.41.126.66
- ReqHeader X-Forwarded-For: 93.41.126.66
- ReqHeader X-Forwarded-Proto: https
- ReqHeader Host: tiles.urbismap.com
- ReqHeader Connection: close
- ReqHeader User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
- ReqHeader Accept: */*
- ReqHeader Sec-Fetch-Site: same-origin
- ReqHeader Sec-Fetch-Mode: cors
- ReqHeader Sec-Fetch-Dest: empty
- ReqHeader Referer: https://tiles.urbismap.com/styles/basemap/
- ReqHeader Accept-Encoding: gzip, deflate, br
- ReqHeader Accept-Language: it-IT,it;q=0.9
- ReqUnset X-Forwarded-For: 93.41.126.66
- ReqHeader X-Forwarded-For: 93.41.126.66, 127.0.0.1
- VCL_call RECV
- VCL_return hash
- ReqUnset Accept-Encoding: gzip, deflate, br
- ReqHeader Accept-Encoding: gzip
- VCL_call HASH
- VCL_return lookup
- Hit 98319 172636.033479 10.000000 0.000000
- VCL_call HIT
- VCL_return deliver
- RespProtocol HTTP/1.1
- RespStatus 200
- RespReason OK
- RespHeader Server: nginx/1.18.0 (Ubuntu)
- RespHeader Date: Mon, 12 Dec 2022 14:21:10 GMT
- RespHeader Content-Type: application/x-protobuf
- RespHeader Content-Length: 31578
- RespHeader Access-Control-Allow-Origin: *
- RespHeader Content-Encoding: gzip
- RespHeader Last-Modified: Wed, 23 Nov 2022 09:25:23 GMT
- RespHeader ETag: W/"7b5a-Lgi1EP0ZRDWVK1iX+VP47MXHk2M"
- RespHeader Expires: Wed, 14 Dec 2022 14:21:10 GMT
- RespHeader Cache-Control: max-age=172800, public, no-transform
- RespHeader Vary: Accept-Encoding
- RespHeader X-Varnish: 98350 98319
- RespHeader Age: 163
- RespHeader Via: 1.1 varnish (Varnish/6.6)
- VCL_call DELIVER
- RespHeader X-Cache: HIT
- VCL_return deliver
- Timestamp Process: 1670855034.759391 0.000089 0.000089
- Filters
- RespHeader Accept-Ranges: bytes
- RespHeader Connection: close
- Timestamp Resp: 1670855034.759479 0.000177 0.000087
- ReqAcct 555 0 555 531 31578 32109
- End

How to generate Python XHR Request in requests.post()

I am trying to get info from a website using AJAX. The Website showing different size for perfume and basically, the price would change when selecting different size.
I checked chrome Network Tab and found it's a XHR request, but looking at the request head I have no idea how to generate the same headers and data with the Requests package.
This is how my code currently looks like:
import requests
url = "https://www.beautyfresh.com/uc_aac"
session = requests.Session()
data = {"attributes[Size]":"100ml"} # I want to get the price for 100ml
headers = {"Referer": "https://www.beautyfresh.com/product/fragrance/men/perfume-fragrance/women/perfume-men/fragrance/perfume/jo-malone-orange-blossom-cologne",}
r = session.post(url,headers=headers,data=data)
print(r.text)
The General information under Chrome Network tab is
Request URL: https://www.beautyfresh.com/uc_aac
Request Method: POST
Status Code: 200 OK
Remote Address: 103.255.250.100:443
Referrer Policy: no-referrer-when-downgrade
The Response Headers is
HTTP/1.1 200 OK
date: Fri, 18 Dec 2020 02:01:05 GMT
expires: Sun, 19 Nov 1978 05:00:00 GMT
x-site: beautyfresh
x-url: /uc_aac
last-modified: Fri, 18 Dec 2020 02:01:05 GMT
x-backend-server: web4
content-type: application/json
x-varnish: 700512226
age: 0
via: 1.1 varnish (Varnish/6.0)
x-cache: MISS
cache-control: Cache-Control: store, no-cache, must-revalidate
accept-ranges: bytes
content-length: 2193
The Request Headers is
POST /uc_aac HTTP/1.1
Host: www.beautyfresh.com
Connection: keep-alive
Content-Length: 164
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Origin: https://www.beautyfresh.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://www.beautyfresh.com/product/fragrance/men/perfume-fragrance/women/perfume-men/fragrance/perfume/jo-malone-orange-blossom-cologne
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: has_js=1; SESSc5f2026dce40de323b60d32130e6ce0b=n7tr5e2fsragf1js6garc6u06n; _ga=GA1.2.959938064.1608216963; _gid=GA1.2.1979056032.1608216963; _v1EmaticSolutionsUTMData=%7B%22utm_source%22%3A%22%22%2C%22utm_medium%22%3A%22%22%2C%22utm_campaign%22%3A%22%22%7D; _fbp=fb.1.1608216963288.1600789170; _v1EmaticSolutionsBye=%7B%2228732%22%3A%7B%2230038%22%3A%7B%22dont_show_till%22%3A%222020-12-20%22%2C%22loop%22%3A1%7D%7D%2C%2228739%22%3A%7B%2230045%22%3A%7B%22dont_show_till%22%3A%222020-12-20%22%2C%22loop%22%3A1%7D%7D%7D; _v1EmaticSolutionsEI=%7B%22c_28739_1%22%3A%5B1%2C1608216997180%2C33181%5D%2C%22c_28732_2%22%3A%5B1%2C1608216969616%2C0%5D%7D; _v1EmaticSolutions=%5B%22fc5d18b3-4077-11eb-970e-0242ac160003%22%2C1608217230870%2C%5B%22IMG%22%2C%22%22%2C1%2C%22glasshouse_fragrances_amalfi_coast_sea_candle_350gr.jpg%22%5D%5D; __atuvc=8%7C51; __atuvs=5fdc0d5961186ea4000; _gat=1; _dc_gtm_UA-63339192-1=1
And Form Data shows:
attributes%5BSize%5D=100ml&nid=2905&qty=1&form_build_id=form-991e88780c30fdf883375a36a986b550&form_id=uc_product_add_to_cart_form_2905&product-nid=2905&aac_nid=2905
I don't actually know how to construct my request so it can be successfully posted to the server the get the proper response. It should return the price for "100ml", but currently my code get nothing.
Thank you so much for any help!
You are missing some information in your data. To receive a response, try adding "aac_nid": "2905" to your data when sending the post request:
import requests
headers = {
"Referer": "https://www.beautyfresh.com/product/fragrance/men/perfume-fragrance/women/perfume-men/fragrance/perfume/jo-malone-orange-blossom-cologne",
}
data = {"attributes[Size]": "30ml", "aac_nid": "2905"}
response = requests.post(
"https://www.beautyfresh.com/uc_aac", headers=headers, data=data
)
>>> print(response.content)
b'{"nid":"2905","model":"690251006564","replacements":{"sellprice":"<div class=\\"product-info sellprice\\"><div class=\'retail_price\'>City Price: <div class=\'product-info retail_price\'><span class=\'uc-price\'>S$110.00<\\/span><\\/div><\\/div>\\r\\n <div class=\'promoprice\'>Our Price: <div class=\'product-info sellprice1\'><span class=\'uc-price\'>S$89.00<\\/span><\\/div><\\/div><\\/div>","model":"<div class=\\"model\\"><span class=\\"label\\">Product Code: <\\/span>690251006564<\\/div>"},"form":"<form action=\\"\\/uc_aac\\" accept-charset=\\"UTF-8\\" method=\\"post\\" id=\\"uc-product-add-to-cart-form\\" class=\\" uc-aac-cart\\">\\n<div><div class=\'attributes\'><div class=\\"form-item\\" id=\\"edit-attributes-Size-wrapper\\">\\n <label for=\\"edit-attributes-Size\\">Size <span class=\\"form-required\\" title=\\"This field is required.\\">*<\\/span><\\/label>\\n <select name=\\"attributes[Size]\\" class=\\"form-select required chosen-widget\\" data-name=\\"Size\\" id=\\"edit-attributes-Size\\" ><option value=\\"30ml\\" selected=\\"selected\\">30ml<\\/option><option value=\\"100ml\\">100ml<\\/option><\\/select>\\n<\\/div>\\n<\\/div><input type=\\"hidden\\" name=\\"nid\\" id=\\"edit-nid\\" value=\\"2905\\" \\/>\\n<div class=\\"form-item\\" id=\\"edit-qty-wrapper\\">\\n <label for=\\"edit-qty\\">Qty <\\/label>\\n <input type=\\"text\\" maxlength=\\"3\\" name=\\"qty\\" id=\\"edit-qty\\" size=\\"5\\" value=\\"1\\" class=\\"form-text textfield\\" \\/>\\n<\\/div>\\n<input type=\\"hidden\\" name=\\"form_build_id\\" id=\\"form-b7adf002178f04ed96377894057352a2\\" value=\\"form-b7adf002178f04ed96377894057352a2\\" \\/>\\n<input type=\\"hidden\\" name=\\"form_id\\" id=\\"edit-uc-product-add-to-cart-form\\" value=\\"uc_product_add_to_cart_form\\" \\/>\\n<input type=\\"hidden\\" name=\\"aac_nid\\" id=\\"edit-aac-nid\\" value=\\"2905\\" \\/>\\n<div class=\'leadtime_message\' style=\'margin-bottom:1em;\'><p>Delivers in 1-3 working days<\\/p><\\/div><input type=\\"submit\\" name=\\"op\\" id=\\"edit-submit-2905\\" value=\\"Add to Cart\\" class=\\"notranslate form-submit node-add-to-cart primary\\" \\/>\\n\\n<\\/div><\\/form>\\n"}'
To get the price, try searching for it with the help of the built-in re (regex) module:
import re
prices = re.findall(r"'uc-price\\'>S(\$\d.*?)<", str(response.content))
print("Original Price:", prices[0])
print("Our Price:", prices[1])
Output:
Original Price: $110.00
Our Price: $89.00

JSON-Encoded POST/PATCH data in R

I want to make a POST to a webserver running a Rails application (I didn't develop the application, I just need to post to it) and I've been trying to use R with little success.
I've been doing this with httr and jsonlite:
install.packages("httr");
install.packages("jsonlite")
library(jsonlite)
library("httr");
url = "http://192.168.0.168:3000/api/styles";
b <- list(name="Lorem", description="Ipsum");
POST(url,body=b,encode='json');
Which nets me the result of actually being able to post but renders a warning from Rails:
Response [http://192.168.0.168:3000/api/styles/18]
Date: 2015-11-06 13:20
Status: 411
Content-Type: text/html; charset=ISO-8859-1
Size: 307 B
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD><TITLE>Length Required</TITLE></HEAD>
<BODY>
<H1>Length Required</H1>
WEBrick::HTTPStatus::LengthRequired
<HR>
<ADDRESS>
WEBrick/1.3.1 (Ruby/2.2.2/2015-04-13) at
192.168.0.168:3000
All other attempts at using other encoding options or content-type headers have given me a warning of 422 Unprocessable Entity.
I have however been successful at doing this in Python with this snippet:
import requests
url = "http://192.168.0.168:3000/api/styles"
payload = {'name': 'Lorem', 'description': 'Ipsum'}
r = requests.post(url, json=payload)
Can anyone shine a light on what am I doing wrong in the R request?
Update 1: I've added the Verbose Option and the output
-> POST /api/styles HTTP/1.1
-> Host: 192.168.0.168:3000
-> User-Agent: libcurl/7.43.0 r-curl/0.9.3 httr/1.0.0
-> Accept-Encoding: gzip, deflate
-> Cookie: request_method=POST
-> Accept: application/json, text/xml, application/xml, */*
-> Content-Type: application/json
-> Content-Length: 38
->
>> {"name":"Lorem","description":"Ipsum"}
<- HTTP/1.1 302 Found
<- X-Frame-Options: SAMEORIGIN
<- X-Xss-Protection: 1; mode=block
<- X-Content-Type-Options: nosniff
<- Location: http://192.168.0.168:3000/api/styles/19
<- Content-Type: text/html; charset=utf-8
<- Cache-Control: no-cache
<- X-Request-Id: b5bbef5f-a627-424d-bbaf-892bf8aac758
<- X-Runtime: 11.910362
<- Server: WEBrick/1.3.1 (Ruby/2.2.2/2015-04-13)
<- Date: Fri, 06 Nov 2015 15:31:48 GMT
<- Content-Length: 105
<- Connection: Keep-Alive
<-
-> POST /api/styles/19 HTTP/1.1
-> Host: 192.168.0.168:3000
-> User-Agent: libcurl/7.43.0 r-curl/0.9.3 httr/1.0.0
-> Accept-Encoding: gzip, deflate
-> Cookie: request_method=POST
-> Accept: application/json, text/xml, application/xml, */*
-> Content-Type: application/json
->
<- HTTP/1.1 411 Length Required
<- Content-Type: text/html; charset=ISO-8859-1
<- Server: WEBrick/1.3.1 (Ruby/2.2.2/2015-04-13)
<- Date: Fri, 06 Nov 2015 15:31:48 GMT
<- Content-Length: 307
<- Connection: close
<-
Response [http://192.168.0.168:3000/api/styles/19]
Date: 2015-11-06 15:31
Status: 411
Content-Type: text/html; charset=ISO-8859-1
Size: 307 B
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD><TITLE>Length Required</TITLE></HEAD>
<BODY>
<H1>Length Required</H1>
WEBrick::HTTPStatus::LengthRequired
<HR>
<ADDRESS>
WEBrick/1.3.1 (Ruby/2.2.2/2015-04-13) at
192.168.0.168:3000

linkedin API person-activities returns 201 but not able to find the updates in web UI

Request:
POST http://api.linkedin.com/v1/people/~/person-activities HTTP/1.1
Accept-Encoding: gzip, deflate
Authorization: OAuth oauth_token="780e395e-995a-41e9-83d6-6bac16046edc", oauth_consumer_key="******", oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1421211087", oauth_nonce="-973828846827772736", oauth_signature="*******"
Content-Type: application/xml
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.7.0_65
Host: api.linkedin.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 187
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><activity locale="en_US"><timestamp>1421211086614</timestamp><content-type>linkedin-html</content-type><body>test2</body></activity>
Response:
HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
x-li-request-id: OJY853L13Z
Vary: Accept-Encoding
Date: Wed, 14 Jan 2015 04:51:22 GMT
X-Li-Fabric: prod-ltx1
Set-Cookie: lidc="b=TB24:g=27:u=159:i=1421211082:t=1421253804:s=803971352"; Expires=Wed, 14 Jan 2015 16:43:24 GMT; domain=.linkedin.com; Path=/
Connection: keep-alive
X-Li-Pop: prod-nsg7
X-LI-UUID: 9lTE+PInuROg1UwMlCsAAA==
Set-Cookie: lidc="b=TB24:g=27:u=159:i=1421211082:t=1421253804:s=803971352"; Expires=Wed, 14 Jan 2015 16:43:24 GMT; domain=.linkedin.com; Path=/
Content-Length: 0
But when I go to my home page # profile->your network update, I am not able to see my posts.
I waited more than 30 mins.

Sample http range request session

Is it possible to show me a sample http session with range requests.
I mean what would be the request and response headers?
The following exchange is between Chrome and a static web server, retrieving an MP4 video.
Initial request - for the video. Note the Accept-Ranges response header to indicate the server has range header support:
GET /BigBuckBunny_320x180.mp4
Cache-Control: max-age=0
Connection: keep-alive
Accept-Language: en-GB,en-US,en
Host: localhost:8080
Range:
Accept: text/html,application/xhtml+xml,application/xml,*/*
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 ...
Accept-Encoding: gzip,deflate,sdch
Accept-Charset: ISO-8859-1,utf-8,*
200 OK
Content-Type: video/mp4
Connection: keep-alive
Last-Modified: Wed,14 Dec 2011 15:50:59 GMT
ETag: A023EF02BD589BC472A2D6774EAE3C58
Transfer-Encoding:
Content-Length: 64657027
Accept-Ranges: bytes
Server: Brisket/1.0.1
Date: Wed,14 Dec 2011 16:11:24 GMT
Range header in previous response detected - subsequent request with open-ended range to confirm support. Response returns a 206 status and Content-Range header to indicate the bytes present in the response body:
GET /BigBuckBunny_320x180.mp4
Connection: keep-alive
Accept-Language: en-GB,en-US,en
Host: localhost:8080
Range: bytes=0-
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 ...
Referer: http://localhost:8080/BigBuckBunny_320x180.mp4
Accept-Encoding: identity
Accept-Charset: ISO-8859-1,utf-8,*
206 Partial Content
Content-Type: video/mp4
Connection: keep-alive
Last-Modified: Wed,14 Dec 2011 15:50:59 GMT
ETag: A023EF02BD589BC472A2D6774EAE3C58
Transfer-Encoding:
Content-Length: 64657027
Accept-Ranges: bytes
Server: Brisket/1.0.1
Date: Wed,14 Dec 2011 16:11:25 GMT
Content-Range: bytes 0-64657026/64657027
Subsequent range request to capture the end of the file (probably to capture trailing metadata):
GET /BigBuckBunny_320x180.mp4
Connection: keep-alive
Accept-Language: en-GB,en-US,en
Host: localhost:8080
Range: bytes=64312833-64657026
Accept: */*
If-Range: A023EF02BD589BC472A2D6774EAE3C58
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 ...
Referer: http://localhost:8080/BigBuckBunny_320x180.mp4
Accept-Encoding: identity
Accept-Charset: ISO-8859-1,utf-8,*
206 Partial Content
Content-Type: video/mp4
Connection: keep-alive
Last-Modified: Wed,14 Dec 2011 15:50:59 GMT
ETag: A023EF02BD589BC472A2D6774EAE3C58
Transfer-Encoding:
Content-Length: 344194
Accept-Ranges: bytes
Server: Brisket/1.0.1
Date: Wed,14 Dec 2011 16:11:25 GMT
Content-Range: bytes 64312833-64657026/64657027
User clicks in the video progress bar beyond the downloaded range - a range request is issued to begin playing from the selected position:
GET /BigBuckBunny_320x180.mp4
Connection: keep-alive
Accept-Language: en-GB,en-US,en
Host: localhost:8080
Range: bytes=1073152-64313343
Accept: */*
If-Range: A023EF02BD589BC472A2D6774EAE3C58
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 ...
Referer: http://localhost:8080/BigBuckBunny_320x180.mp4
Accept-Encoding: identity
Accept-Charset: ISO-8859-1,utf-8,*
206 Partial Content
Content-Type: video/mp4
Connection: keep-alive
Last-Modified: Wed,14 Dec 2011 15:50:59 GMT
ETag: A023EF02BD589BC472A2D6774EAE3C58
Transfer-Encoding:
Content-Length: 63240192
Accept-Ranges: bytes
Server: Brisket/1.0.1
Date: Wed,14 Dec 2011 16:11:25 GMT
Content-Range: bytes 1073152-64313343/64657027

Resources