2017년 1월 13일 금요일

web components and header filelds


I'm implementing a POST request where the response will include a Location HTTP header:


so the question is: how I can take Location field from the header using only web components?

-- 
how does an example response look like?
just extract the location information from the response, see the available text blocks here http://appinventor.mit.edu/explore/ai2/support/blocks/text.html

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

--
I'm reading this page in order to upload a video on youtube:


in this page at Step 2 is wrote

If your request succeeds, the API server will respond with a 200 (OK) HTTP status code, and the response will include a Location HTTP header that specifies the URI for the resumable session. This is the URI that you will use to upload your video file.
The example below shows a sample API response to the request in step 1:
so my question is if I can use web component or not to implement a upload video file on youtube (web.got hasn't a Location field).

--
probably yes, you will have to try it
my guess is, you will get the location in the responseContent of the Web.GotText event

-- 
But web.got give access to header?

--
it has been said " the response will include a Location HTTP header
therefore my guess is, you will get the location in the responseContent of the Web.GotText event
just try something to find it out, see also tip 2 here

--
the responseContent is empty, also if responseCode=200, for this reason I've posted it.
--
which means, the web component currently is not able to receive that information

you might want to create your own web extension and add the response header as parameter in the web.gottext event

more information about how to create an extension see here Announcing App Inventor Extension Components
however that will be more advanced and will require some Java skills...

--

댓글 없음:

댓글 쓰기