![]() ![]() If the operation was successful, the HTTP status code will be 200 (OK). ![]() Note that for the service to parse such POST information correctly, the “Content-Type: application/x-See here for more information on content type encoding. ![]() ![]() With “cid=1,2,3,4,5” in the POST body, would retrieve a CSV-formatted table of results for these CIDs. For example, a list of CID integers – which may be too long to fit within the size limitations of a GET request URL – may be moved to the POST body: Some parts of the URL may be moved to the body of a POST request, rather than being part of the URL path. For correct parsing of any POST body, the proper content type header must be included in the request header (see below). for SMILES input may need to be URL encoded for example, “smiles=C1C1” should be encoded as “smiles=C1C%5BCH%2B%5D1”. With “Accept: chemical/x-mdl-sdfile” in the request header will return CID 2244 in SDF format.įor proper transmission of certain special characters, strings passed e.g. XML data will have “Content-Type: application/xml”. The Content-Type in the HTTP response header will also be set by the reverse of the above table, e.g. The value of “Accept” may be a MIME type that will tell the service what output format is accepted by the client, and hence what format is returned by the server. The HTTP request header may be used to supply some types of information to this service. JSONP takes an optional callback function name (which defaults to “callback” if not specified). TXT output is only available in a restricted set of cases where all the information is the same – for example, synonyms for a single CID where there is one synonym per line.įor example, to access the molecular formula for CID 2244 in JSON format, one would use the (now complete) URL: Note that not all formats are applicable to the results of all operations one cannot, for example, retrieve a whole compound record as CSV or a property table as SDF. = XML | ASNT | ASNB | JSON | JSONP | SDF | CSV | PNG | TXTĪSNT is NCBI’s text (human-readable) variant of ASN.1 ASNB is standard binary ASN.1 and is currently returned as Base64-encoded ascii text. Note that this is formally optional, as output format can also be specified in the HTTP Accept field of the request header – see below for more detail. The final portion of the URL tells the service what output format is desired. Pathway domain = summary | cids | geneids | accessionsįor example, to access the molecular formula and InChI key for CID 2244, one would use a URL like: Protein domain = summary | aids | concise | pwaccs Gene domain = summary | aids | concise | pwaccs = substance | compound | assay | gene | protein | pathway | taxonomy | cell | Ĭompound domain = cid | name | smiles | inchi | sdf | inchikey | formula | | | listkey | This is further subdivided into two or more locations in the URL “path” as follows: The input portion of the URL tells the service which records to use as the subject of the query. The general form of the URL has three parts – input, operation, and output – after the common prefix, followed by operation options as URL arguments (after the ‘?’): Most – if not all – of the information the service needs to produce its results is encoded into the URL. #TO REST SYNONYM HOW TO#Example Perl scripts demonstrating how to access PubChem data through PUG-REST are available here. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |